Skip to content

feat: live Codex captures, questions asked in a reply, and ending turns Codex never ends (#280) - #390

Merged
BunsDev merged 3 commits into
mainfrom
cf7-codex-capture
Oct 23, 2026
Merged

BunsDev merged 3 commits into
mainfrom
cf7-codex-capture

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Live Codex captures for CF-7 (#280): two real codex-cli 0.163.0 turns that each ask a clarification, saved as redacted fixtures and replayed through the Codex backend and the runner into the task record.

Capture (2026-10-23, Val's authorization in the CF-7 goal; codex --version: codex-cli 0.163.0). A direct app-server probe used Modex's thread/start/turn/start parameters in a disposable repo, in default collaboration mode, with --enable default_mode_request_user_input. The prompt asked the model to record a plan with its plan tool, ask one question, then edit and check. Account, MCP-startup, rate-limit, token-usage and moderation lines were dropped, and paths were redacted to /repo and ~. Everything else is verbatim, in both directions.

Model Plan Question Then
gpt-6.1-sol none: "the plan tool isn't available in this session" item/tool/requestUserInput, same shape as the 2026-10-20 capture answered English, edited greeting.txt, ran node check.js (exit 0); no turn/completed within 600 s, thread stayed active
gpt-6-astra (from the user's Codex config) none, same reason agentMessage with delivery: "async", questions: [{title, options}] (AsyncUserInputQuestion) two sleep items of 60 000 ms, then completed still waiting

How the live shape differs from our scripted 0.163.0 shape: there's no turn/plan/updated, so a real turn's plan is still unobserved. There's an async question shape and a sleep item, and a turn can go missing its turn/completed. Parser: no change was needed. The replay shows the clarification, file and command in the record, and no plan. Async questions show as Codex's text with no card, and sleeps don't show as tools. The gpt-6.1-sol replay supplies the missing turn/completed itself, and the test says so.

Red-first, honestly: the first runs failed only on my own expectations: the record keeps the command as Codex reported it, and the Markdown line format. The backend read both live shapes correctly from the start, so there was no parser fix to drive red.

Val's decisions (2026-10-23), now in this PR:

  • Questions asked in a reply. agentMessage.questions are kept with the reply as asks. The reply lists each question with its options, and pressing an option sends it as the next message. Only the latest reply's options are live, and only while no turn runs. The task record lists each one as "asked in a message". The e2e test is e2e/message-asks.spec.ts.
  • A turn Codex never ends. After the final answer, with no command running and no request open, Modex waits quietAfterFinalMs (5 min). If nothing more arrives, it ends the turn with a notice and sends turn/interrupt; any later item resets the wait. The red-first test is the replayed live capture with no synthetic turn/completed: it hung before the change. A second test covers a command that outlives the answer.
  • One more live plan attempt. Two more gpt-6.1-sol turns asked directly for update_plan: one without the question flag, one also with --disable goals. Both said the tool wasn't provided. They add no new shape, so they aren't saved as fixtures.

Rebased onto #385, which runs Plan mode in Codex's plan collaboration mode, and onto #387.

Checks (after the rebase): build passed. Unit: 0 failed; 2 timed out under load (runner: an unconfirmed stop…, demo waits for a slow turn…) and both pass alone. e2e: 389 passed; 1 failed under load (conversation-rendering.spec.ts:138) and passes alone.

Earlier checks: pnpm build passed. pnpm test: 0 failed, 0 cancelled. pnpm test:e2e: 388 + 7 passed, 6 skipped.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 23, 2026 6:48am UTC

Request Review

@github-code-quality

github-code-quality Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main 68860a0 cf7-codex-capture 591e3b8 +/-
65% 65% 0%
View coverage of the 5 most impacted files.
File main 68860a0 cf7-codex-capture 591e3b8 +/-
apps/desktop/sr...ation-events.ts 98% 97% -1%
apps/desktop/sr...images/store.ts 94% 94% 0%
apps/desktop/sr...ngine/runner.ts 98% 98% 0%
apps/desktop/sr...task-context.ts 100% 100% 0%
apps/desktop/sr...ckends/codex.ts 97% 98% +1%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 23, 2026 07:29 UTC

@BunsDev
BunsDev enabled auto-merge October 23, 2026 04:57
@BunsDev BunsDev changed the title test: replay two live Codex turns with a clarification into the task record (#280) feat: live Codex captures, questions asked in a reply, and ending turns Codex never ends (#280) Oct 23, 2026
@BunsDev
BunsDev added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 23, 2026
@BunsDev
BunsDev enabled auto-merge October 23, 2026 05:46
@BunsDev
BunsDev added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 23, 2026
BunsDev and others added 3 commits October 23, 2026 01:43
…record (#280)

Two codex-cli 0.163.0 app-server turns, captured 2026-10-23 in a disposable
repo with default_mode_request_user_input enabled, redacted into fixtures and
replayed through the Codex backend and the runner.

gpt-6.1-sol asked through requestUserInput; its clarification, edit and
command reach the task record. gpt-6-astra asked through an async agent
message (AsyncUserInputQuestion) and slept twice; Modex shows the text and
no card. Neither model sent turn/plan/updated: both said their plan tool was
not available. The gpt-6.1-sol turn sent no turn/completed within 600 s. No
parser change was needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ends (#280)

From the live codex-cli 0.163.0 captures, as Val decided:

- agentMessage.questions (AsyncUserInputQuestion) are kept with the reply as
  asks. The reply shows each question's options; pressing one sends it as the
  next message, from the latest reply only and while no turn runs. The task
  record lists it as asked in a message.
- After Codex's final answer, with no command or request open, Modex waits
  quietAfterFinalMs (5 minutes) for turn/completed, then ends the turn with a
  notice and sends turn/interrupt. Any later item resets the wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@BunsDev
BunsDev enabled auto-merge October 23, 2026 06:47
@BunsDev
BunsDev added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 2824ed7 Oct 23, 2026
13 checks passed
@BunsDev
BunsDev deleted the cf7-codex-capture branch October 23, 2026 08:03

This branch was successfully deployed

1 active deployment
Preview — 591e3b8b Deployed Oct 23, 2026 by vercel[bot]
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