Skip to content

feat: read Claude's task tools and Codex's proposed plan from live captures (#280) - #394

Merged
BunsDev merged 2 commits into
mainfrom
cf7-live-plans
Oct 24, 2026
Merged

BunsDev merged 2 commits into
mainfrom
cf7-live-plans

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Closes the last two open CF-7 (#280) items, both from live captures taken on 2026-10-23.

Claude's task tools (Val's option 1)

Claude Code 2.1.309, run with Modex's own arguments plus CLAUDE_CODE_ENABLE_TODO_TOOLS=1, loaded TaskCreate/TaskUpdate through ToolSearch. It created three tasks and updated them as it worked. The redacted capture is test/fixtures/claude-tasks-2.1.309.jsonl.

  • Modex now reads these calls as the turn's plan, with source claude-tasks ("Claude's task list").
  • A call counts only once its tool_result confirms it. The task id is the number in "Task #N created".
  • An update to a task this turn didn't create is skipped, not guessed. deleted removes the task.
  • Modex does not set the variable, as Val chose (option 1, not option 2).
  • In the capture, node check.js failed because the throwaway repo sat under a "type": "module" package. Claude left that task in progress, and the plan shows it as In progress, not done.

Codex plan mode

A live gpt-6.1-sol turn in plan collaboration mode, which Modex has used since #385, asked its question through requestUserInput, then completed a plan item. The redacted capture is test/fixtures/codex-plan-mode-0.163.0.jsonl. The replay exposed two bugs:

  • False "no plan" line. The turn ran read commands, so feat: a turn says when its CLI reported no plan (#280) #391's footer said "Codex reported no plan" next to the plan. Fix: the task record keeps the plan as proposedPlan. The note and the read-only view show it under Plan as "Codex proposed this plan in plan mode", and the false line is gone.
  • Turn never ended. Codex sent no turn/completed. Modex's quiet-end only followed a final answer, so the turn would have stayed open forever. Fix: a completed plan item now starts the same quiet-end timer, with its own notice. Red check: with codex.ts reverted, the new replay test hangs. With the fix, it passes.

A turn/plan/updated step plan has still not been seen live; four default-mode turns never offered the tool. docs/task-context.md says so.

Checks

  • pnpm build && pnpm test: pass.
  • pnpm test:e2e: 392 passed, 7 skipped.
  • e2e/codex-native-plan.spec.ts now has its scripted plan-mode turn run a read command, as the live one did. It checks that the footer shows no "no plan" line, and that the saved note's view shows the proposed plan.

🤖 Generated with Claude Code

…ptures (#280)

Two live turns captured on 2026-10-23 and replayed as fixtures:

- Claude Code 2.1.309 with CLAUDE_CODE_ENABLE_TODO_TOOLS=1 used TaskCreate and
  TaskUpdate. Modex now reads them as the turn's plan (from "claude-tasks"),
  counting each call once its result confirms it. Modex does not set the
  variable, as Val chose (option 1).
- codex-cli 0.163.0 in plan collaboration mode asked through requestUserInput
  and completed a `plan` item. The task record keeps it as `proposedPlan`, so
  the turn does not say "no plan". It sent no turn/completed, so the quiet-end
  now also follows a proposed plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 9:00pm 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 203a350 cf7-live-plans 28f14db +/-
65% 65% 0%

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


Updated October 23, 2026 22:39 UTC

BunsDev commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Acceptance review — one cancellation defect remains

I reviewed #394 against #280, including the captured Claude task calls, the live Codex plan-mode replay, the saved-note representation, and the plan quiet-end logic.

Finding — plan quiet-end can report a user-stopped turn as completed. After a completed plan item, answered === "plan" starts the quiet timer. If the user presses Stop and Codex emits no further event (a missing turn/completed is demonstrated by the live capture), onAbort marks the signal aborted and sends turn/interrupt, but does not clear this timer. When it fires, the guard at apps/desktop/src/main/engine/backends/codex.ts:450 does not check signal.aborted; interrupt() is then a no-op because an interrupt was already sent, and the callback calls finish({ status: "completed" }). A user-cancelled turn can therefore become successful after the quiet period.

Requested correction: preserve the existing stop/acknowledgment semantics when quiet-end races with cancellation; it must not record the cancelled turn as completed. Add a replay regression for completed plan item → user Stop → no terminal Codex event through the quiet timeout, and assert the turn is not reported as successfully completed.

Other acceptance observations: Claude TaskCreate is only added after a matching task-created result; TaskUpdate is limited to task IDs created in the same turn; the capture leaves the failed check's task in progress; the Codex proposed plan is kept as an explicitly proposed, status-free plan in the saved note. The environment flag is not enabled by Modex. Tests and replay fixtures do not establish that a native turn/plan/updated event has been observed live, and the PR correctly records that limit.

The reported build/unit/E2E results are useful regression evidence, but the cancellation defect should be fixed and retested before #394 enters the merge queue.

@BunsDev

BunsDev commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks — confirmed and fixed in 28f14db.

  • Red first: a new replay test (a Stop after the proposed plan is never turned into a completed turn by the quiet end) runs the plan-mode capture: plan item completes, the user presses Stop, and Codex sends nothing past the quiet period. Before the fix the turn went idle as completed.
  • Fix: onAbort clears the quiet timer, and the timer and its re-arming now check signal.aborted. A stopped turn stays running until Codex answers the interrupt. This also covers the final-answer path from feat: live Codex captures, questions asked in a reply, and ending turns Codex never ends (#280) #390, which shared the guard.
  • The test asserts the turn is still running 300 ms after Stop (quiet period 50 ms), that no "did not report the turn finished" notice appears, and that only the stop's own turn/interrupt was sent. After Codex's turn/completed with interrupted, the turn ends with no completion notice.
  • pnpm build && pnpm test pass; codex-native-plan, message-asks and task-to-notes e2e pass 8/8. The change is main-process only.

🤖 Generated with Claude Code

#280)

After Codex's final answer or proposed plan, the quiet timer could fire after
the user pressed Stop and record the stopped turn as completed. Stop now clears
the timer, and the timer never ends a turn whose signal is aborted: a stopped
turn waits for Codex to acknowledge the interrupt, as any stop does.

Regression: live plan-mode replay, Stop after the plan item, no further Codex
event past the quiet period. Red before the fix (the turn went idle).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BunsDev
BunsDev added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 70123b9 Oct 24, 2026
16 of 19 checks passed
@BunsDev
BunsDev deleted the cf7-live-plans branch October 24, 2026 00:01

This branch was successfully deployed

1 active deployment
Preview — 28f14dbd 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