Repository navigation
fix(server): identify delegated Codex threads as subagents - #36535
StiensWout wants to merge 3 commits into
Conversation
Co-authored-by: GPT 6.1 Sol <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Grok 4.7 <[email protected]> Co-authored-by: OpenRouter Free <[email protected]>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Codex thread creation and forks now identify delegated threads using stored delegation metadata instead of ID prefixes. This is a narrowly scoped classification correction with no apparent material operational or customer-data risk. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…tart Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dismissing prior approval to re-evaluate 080916e
Main's pingdotgg#36525 marks delegate_task children as Codex subagents by thread ID prefix on thread/start. This branch reads the thread's stored delegation classification instead, which also covers native forks, recovery sessions and tasks delegated from linked environments, so the merge keeps that one signal and drops the ID-prefix check, its helper and its duplicate test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dismissing prior approval to re-evaluate 0c949cf
|
The automated pipeline ran the reported steps in the real app without this change, and the problem did not appear. So it cannot show that this change fixes anything. What was run on On each commit, configure the same stdio MCP logger for params._meta["x-codex-turn-metadata"]. Open a new Codex thread through the web client. Submit the same prompt asking the parent to call the logger with label parent, then use T3 delegate_task to create one new Codex child using gpt-6-luna without a worktree, have it call the same logger with label child, and wait for completion. Compare the actual logged metadata. Both base and head omitted thread_source for the parent and included thread_source: "subagent" for the child. How: Manual real-app comparison: separate worktrees running vp run dev, fresh isolated T3 databases with T3CODE_DEV_SEED=0, synthetic project, isolated Codex homes, real Codex CLI 0.169.0 using gpt-6-luna. Web client driven through the preview browser at 1280x800 in light theme. Replay scenarios were unsuitable because this requires Codex-specific MCP behavior. Both recordings and screenshots were inspected; final screenshots matched a second capture taken at least 500 ms later. Servers, tabs, worktrees and scratch state were cleaned up. Closing this pull request. #36520 has been asked for the missing steps; once the problem can be shown this can be reopened, or the fix built again. |
Codex children created by
delegate_taskhad no source classification, so their MCP tool calls looked like calls from user-opened threads.Pass the stored delegation classification through provider thread creation and send
threadSource: "subagent"on Codex starts and native forks. Fresh recovery sessions use the same classification; ordinary threads keep their existing behavior. Existing native sessions are not reclassified.Fixes #36520.
Validation: protocol tests fail before the fix and pass with it;
pnpm exec vp run check:changed pingdotgg/mainpasses. An isolated Codex 0.169.0 app-server confirmed the start request behavior:Local Cubic found no issues; repository-specific context was unavailable for the fork.
Council review
Rounds: 1
No blocking findings. Non-blocking nit: service-side flag forwarding is verified by code review rather than a second regression test layer; tests exercise the real Codex adapter's protocol contract. The optional OpenRouter Free guest returned no substantive review.
Created with GPT 6.1 Sol in T3 Code through the Codex harness. Reviewed by Claude Opus 5.5 and Grok 4.7, with an attempted OpenRouter Free guest review.