Add Codex chat forking for trace debugging#17
Open
goyalayus wants to merge 17 commits into
Open
Conversation
36bb24d to
7f20137
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a Codex-only path for trace debugging where an existing Codex session can be used as context without mutating the original session.
When the message pane is attached to a trace and Codex is the active provider, selecting an existing Codex chat marks it as the fork source. The next message creates a new Codex session file from that source, attaches the current trace context, and continues through the existing
codex exec --jsonstreaming path. Claude behavior is unchanged.Why
codex forkis currently a top-level interactive TUI command, so it cannot be used directly from Workshop's JSON streaming chat. This patch performs the fork at the Codex session-file layer, then resumes the new session through the non-interactive JSON path Workshop already supports.Verification
bun x eslint app/src/components/MessagePane.tsx src/codex-sessions.ts src/server.ts— passes with one existing React hooks warning inMessagePane.tsx.bun x tsc --noEmit --pretty falsecd app && bun x vite build/api/agent/messagesintercepted, and verified the browser sentsession_id: null, a non-emptyfork_session_id, the tracerun_id, and the entered content.session_metais treated as the current session and ancestor metadata is preserved.Notes
cd app && bun x tsc --noEmit --pretty falsestill fails on the existing React/lucide type-version mismatch across the app, plus existing unrelated errors. The root/backend typecheck passes.