Add excludeTurns parameter to thread/resume and thread/fork#19014
Add excludeTurns parameter to thread/resume and thread/fork#19014
Conversation
There was a problem hiding this comment.
💡 Codex Review
codex/codex-rs/app-server/src/codex_message_processor.rs
Lines 4531 to 4534 in 7234f92
With include_turns: false, response.thread.turns is empty. This line computes token_usage_turn_id from token_usage_thread, so latest_token_usage_turn_id_from_rollout_items returns None; replay then falls back to an empty turn_id in thread/tokenUsage/updated. That breaks restored-usage attribution for resumed threads. The same pattern appears in the running-thread path at line 8583.
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f569b85c3d
ℹ️ 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".
1320627 to
87c931d
Compare
87c931d to
050323d
Compare
For callers who expect to be paginating the results, they can now call thread/resume with includeTurns:false so it will not fetch any pages of turns, and instead only set up the subscription. That call can be immediately followed by pagination requests to thread/turns/list to fetch pages of turns according to the UI's current interactions.
050323d to
ebea393
Compare
For callers who expect to be paginating the results for the UI, they can now call thread/resume or thread/fork with excludeturns:true so it will not fetch any pages of turns, and instead only set up the subscription. That call can be immediately followed by pagination requests to thread/turns/list to fetch pages of turns according to the UI's current interactions.