Repository navigation
fix(native-chat): give the chat option write its clock (main typecheck) - #28570
Closed
brennanb2025 wants to merge 1 commit into
Closed
brennanb2025 wants to merge 1 commit into
brennanb2025 wants to merge 1 commit into
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
Contributor
Contributor
Author
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Two recent fixes merged around the same time and don't fit together, so
mainno longer typechecks. One of them created the code path that saves a chat's option (model, effort or permission mode) when you send a message. The other made the permission-mode save read the current time from that path's context, but the first never put a clock there. This adds the missing clock, one line.What Changed
Before:
mainfailspnpm run typecheck:node:At runtime, a permission-mode change written through this path calls
ctx.now()on a context that has nonow, and throws.After: the context carries
now: () => context.now(), the same way the sibling contexts in the same file and instructured-agent-session-mutation-context.tsdo.How it happened: #27826 created
writeStructuredAgentSessionOptionwith a context that had nonow. #28268 then maderecordStructuredAgentSessionOptionIntentsave the permission mode on its own record field, stamped withctx.now(). Each PR typechecked on its own base.Why
This is the smallest fix and matches how every other context in this module supplies its clock. The typecheck error itself guards against this happening again, so no new test is added.
Linked Issue
None. Found while rebasing #28540 onto
mainat b91795a.Visual Proof
N/A: the fix restores a compile-time contract. No UI changes.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
With
main's version of the file,pnpm run typecheck:nodefails with the error above. With this change,pnpm tc:nodepasses.No new test: the typecheck is what pins this.
Notes
No wire, persistence or platform impact. It only supplies a clock that already exists on the context.