Skip to content

Add Codex chat forking for trace debugging#17

Open
goyalayus wants to merge 17 commits into
raindrop-ai:mainfrom
goyalayus:feature/fork-existing-agent-chat
Open

Add Codex chat forking for trace debugging#17
goyalayus wants to merge 17 commits into
raindrop-ai:mainfrom
goyalayus:feature/fork-existing-agent-chat

Conversation

@goyalayus
Copy link
Copy Markdown

@goyalayus goyalayus commented May 24, 2026

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 --json streaming path. Claude behavior is unchanged.

Why

codex fork is 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 in MessagePane.tsx.
  • bun x tsc --noEmit --pretty false
  • cd app && bun x vite build
  • Headless Chrome UI smoke test against local Workshop: opened a trace, selected an existing Codex chat, saw the fork notice, sent a message with /api/agent/messages intercepted, and verified the browser sent session_id: null, a non-empty fork_session_id, the trace run_id, and the entered content.
  • Session-file smoke test against a real local forked Codex session: verified the first session_meta is treated as the current session and ancestor metadata is preserved.

Notes

cd app && bun x tsc --noEmit --pretty false still fails on the existing React/lucide type-version mismatch across the app, plus existing unrelated errors. The root/backend typecheck passes.

@goyalayus goyalayus force-pushed the feature/fork-existing-agent-chat branch from 36bb24d to 7f20137 Compare May 24, 2026 11:56
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