Skip to content

[codex] Fix Codex resume and subagent lifecycle routing#389

Draft
duxiaoxiong wants to merge 82 commits intotiann:mainfrom
duxiaoxiong:fix/codex-resume-path
Draft

[codex] Fix Codex resume and subagent lifecycle routing#389
duxiaoxiong wants to merge 82 commits intotiann:mainfrom
duxiaoxiong:fix/codex-resume-path

Conversation

@duxiaoxiong
Copy link
Copy Markdown

Summary

  • fix Codex deterministic resume and strict remote reattach so explicit resume binds the correct transcript and fails cleanly when live reattach fails
  • add Codex replay/live subagent lifecycle cards with nested child transcript routing, parallel child separation, child tool nesting, and child title isolation
  • polish lifecycle summaries and subagent dialog behavior so completed waits prefer child messages and opened cards show the full delegated prompt

Root cause

Codex had multiple mismatches across replay and live paths:

  • explicit resume still depended on fuzzy/date-window transcript scanning
  • live remote events for subagents were not normalized into the same sidechain/lifecycle model as replayed transcripts
  • parallel child sessions and wait results could be misattributed, causing replies/tool calls to land in the wrong lifecycle card or leak to the root timeline
  • child title changes could mutate the parent session title

Impact

  • Codex resume is now deterministic and stricter
  • replayed and live Codex subagents render as lifecycle cards with nested child conversations
  • parallel subagents stay separated more reliably
  • child tool activity can stay inside each subagent card
  • parent titles are protected from child rename attempts

Validation

Verified on Linux

  • cd web && bun run test -- src/chat/codexSidechain.test.ts src/chat/reducer.test.ts src/components/AssistantChat/messages/CodexSubagentPreviewCard.test.tsx && bun run typecheck
  • cd cli && bun run test -- src/codex/codexRemoteLauncher.test.ts src/codex/utils/appServerEventConverter.test.ts src/codex/utils/codexSessionScanner.test.ts src/codex/utils/codexEventConverter.test.ts && bun run typecheck
  • manual validation on Linux dev services with real Codex sessions under /home/xiaoxiong/papers/paper_process

macOS

  • Not verified

duxiaoxiong and others added 30 commits April 4, 2026 01:17
Root causes:\n- mobile composer still relied on assistant-ui attachment state, which was brittle on Android/PWA and could open the picker without surfacing an uploaded attachment in the composer\n- attachment uploads for inactive sessions did not consistently reuse the same resume/session-resolution flow as text sends\n- hub HTTP routes inherited Bun's socket handler maxRequestBodySize, which was ~1MB from @socket.io/bun-engine, so a normal 2.06MB JPEG was rejected with HTTP 413 before the upload route logic even ran\n\nFixes:\n- replace the mobile attachment entry with a native label/input picker and move composer attachment state to HAPI-managed state in HappyComposer\n- route picker uploads and pasted images through shared upload/delete helpers that resolve the active session before uploading\n- reuse the router's session-resolution and navigation callbacks for attachment sends so uploads follow the same resume path as text sends\n- raise normal HTTP request body handling to at least 100MB instead of inheriting the socket engine's 1MB ceiling\n- add focused web and hub tests for the attachment flow and request-body-size floor\n\nResult:\n- Android can now select an image, see it appear in the composer, send it through the normal message path, and upload files larger than the old 1MB server ceiling
Add a read-only Session Info entry under the session header's More menu. The dialog exposes agent flavor, working directory, HAPI session id, and the imported source session id without adding noise to the main chat view. Includes i18n strings and a focused SessionHeader test.
… vite allowedHosts

- Generalize MessageQueue2 from string to generic TMessage for agent-neutral queuing
- Add attachment-to-input mapping in appServerConfig for mobile image uploads
- Extract vite allowedHosts into configurable helper with env var support
- Make React Query devtools conditional on VITE_SHOW_QUERY_DEVTOOLS env var
- Harden sessionScanner null returns and remote launcher test coverage

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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