[codex] Carry source thread ID in forked history#25662
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8d2349c93
ℹ️ 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".
| Ok(InitialHistory::Forked( | ||
| history | ||
| Ok(InitialHistory::Forked(ForkedHistory { | ||
| source_thread_id: ThreadId::from_string(thread_id).ok(), |
There was a problem hiding this comment.
Do not reuse ignored resume id as fork source
When thread/resume supplies history, the v2 contract says history takes precedence and thread_id is ignored (app-server-protocol/src/protocol/v2/thread.rs lines 321-323). Copying that parameter into ForkedHistory means any parseable placeholder or unrelated id is persisted and returned as thread.forkedFromId; clients such as the TUI then treat it as real fork lineage and immediately issue thread/read for that parent while mapping the resume response. This makes history-based resumes expose bogus parent metadata and can trigger spurious parent lookups unless the source is carried in a separate validated field or left None.
Useful? React with 👍 / 👎.
Summary
Validation
just fmt