-
Notifications
You must be signed in to change notification settings - Fork 7.6k
fix(app-server, core): defer initial context write to rollout file until first turn #9950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…des on thread/resume
68d3b8d to
ed26d86
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31590809ee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let initial_context_seeded = sess.state.lock().await.initial_context_seeded; | ||
| if !initial_context_seeded { | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Persist override updates when initial context isn't seeded
Because initial_context_seeded is set to false on resumed sessions, this early return skips recording any OverrideTurnContext update items. If a user resumes a thread, tweaks settings (e.g., cwd/approval/collaboration/personality), and then closes without starting a turn, those changes stay in memory only and are never written to the rollout, so they’re lost on the next resume and updated_at doesn’t reflect the modification. Previously overrides were persisted immediately, so this is a behavior regression for resumed threads.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's fine for now
Overview
Currently calling
thread/resumewill always bump the thread'supdated_attimestamp. This PR makes it theupdated_attimestamp changes only if a turn is triggered.Additonal context
What we typically do on resuming a thread is always writing “initial context” to the rollout file immediately. This initial context includes:
This PR defers writing the “initial context” to the rollout file until the first
turn/start, so we don't inadvertently bump the thread'supdated_attimestamp until a turn is actually triggered.This works even though both
thread/resumeandturn/startaccept overrides (such asmodel,cwd, etc.) because the initial context is seeded from the effectiveTurnContextin memory, computed atturn/starttime, after both sets of overrides have been applied.NOTE: This is a very short-lived solution until we introduce sqlite. Then we can remove this.