Skip to content

[codex] Carry source thread ID in forked history#25662

Closed
aibrahim-oai wants to merge 1 commit into
mainfrom
codex/forked-history-source-thread
Closed

[codex] Carry source thread ID in forked history#25662
aibrahim-oai wants to merge 1 commit into
mainfrom
codex/forked-history-source-thread

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

@aibrahim-oai aibrahim-oai commented Jun 1, 2026

Summary

  • Store the immediate source thread ID alongside forked rollout history.
  • Preserve that provenance through normal subagent forks, guardian snapshots, app-server resume, and internal history transformations.
  • Leave imported external transcripts without a source thread ID instead of inferring one from copied metadata.

Validation

  • just fmt
  • Online CI

@aibrahim-oai aibrahim-oai requested a review from a team as a code owner June 1, 2026 18:15
@aibrahim-oai
Copy link
Copy Markdown
Collaborator Author

This change is part of the following stack:

Change managed by git-spice.

@aibrahim-oai aibrahim-oai changed the title [codex] Avoid forced directory refresh during plugin install auth checks (#25381) [codex] Carry source thread ID in forked history Jun 1, 2026
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a 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: 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(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant