Skip to content

fix(codex): deliver task-suggestion tools to Codex-harness runs with calibrated guidance - #121568

Merged
steipete merged 1 commit into
mainfrom
steipete/spawn-task-tool-guidance
Aug 10, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/spawn-task-tool-guidance

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Two defects found while live-testing the task-suggestion feature with a real OpenAI-backed web session against a dev gateway:

  1. spawn_task/dismiss_task never existed for Codex-harness runs (P1). The Codex app-server tool builder forwards run facts into createOpenClawCodingTools but dropped taskSuggestionDeliveryMode — the exact sibling-harness omission class already fixed there once for clientCaps (the comment above the fix line documents that precedent). Every GPT-backed session silently lacked the tools while Anthropic-backed sessions (native embedded runner, which forwards the mode) had them. Proven live: a Control UI session on gpt-5.6-luna answered "None" when asked to list tools containing "task"; after the one-line forward it answers spawn_task, and instrumented runs show the mode arriving as "gateway" at tool construction.
  2. The model-facing tool text was too thin to steer usage. The previous description ("Suggest confirmed valuable out-of-scope follow-up… Operator suggestion only; does not start work.") carried no anti-noise guidance, no explanation of what the card does, no self-containment rule for the prompt, and no ephemerality warning — and in six controlled live iterations GPT models either ignored follow-up bait entirely or reported follow-ups in prose ("Follow-up noted: …") that no one ever sees again.

Why This Change Was Made

The tool advertises itself exclusively through its schema (deliberately — it is gated per session, so static prompt text would be hallucination bait). That makes the description the entire model-facing product surface. This PR ports the calibration that the equivalent Claude Code tool ships: when to use it (work you were not asked to do, surfacing along the way), when not to (vague code smells, low-confidence hunches), that scope requests apply to doing the work rather than flagging it, that a follow-up described only in prose is lost, the lexical bridge from operator phrasing ("flag it as a follow-up", "note that for later") to the tool, prompt self-containment, the git-checkout cwd requirement, and registry ephemerality. dismiss_task gains the replace pattern (spawn the better card first, then dismiss) and the pending-only rule. Parameter descriptions now say where each field renders (card title/session name, card summary, expander).

User Impact

  • GPT-backed sessions (Codex harness) can now produce suggested-task cards at all — previously the capability simply did not exist for them, with no error and no trace.
  • Live-verified end to end on gpt-5.6-sol: given a natural request ("if you spot anything else worth doing, put it on a suggested-task card"), the model completed the scoped work, called spawn_task with the correct repo cwd, and the card rendered in the Control UI ("Remove the legacy sum alias") — screenshot below.
  • Calibration reality, documented from the same live sessions: with the enriched text GPT models now reliably notice and hold out-of-scope items ("Follow-up: … left untouched as requested") but still prefer prose over the tool unless the operator's phrasing evokes a task/card artifact; fully spontaneous card creation under bare scope instructions was not achieved with Luna/medium or Sol/high. That gap is a harness-prompt/model-calibration matter, not a description one — the description is now at parity with the Claude Code original that exhibits spontaneous use on Claude models.

Evidence

  • Live before/after on a dev gateway (isolated state dir, Control UI driven by Playwright, real OpenAI models): tool-listing probe "None" → spawn_task; instrumented delivery-mode trace admission "gateway" → reply run "gateway" → runner dispatch "gateway" → tool build null pre-fix, "gateway" end-to-end post-fix; final natural-language run produced a live card (screenshot embedded).
  • New regression test in extensions/codex/src/app-server/dynamic-tool-build.test.ts mirroring the existing clientCaps sibling-forward regression: the Codex tool builder must forward taskSuggestionDeliveryMode into createOpenClawCodingTools.
  • src/agents/tools/task-suggestion-tools.test.ts green (schema/param behavior unchanged; descriptions only).
  • oxlint / oxfmt clean on all touched files.
  • Autoreview clean (see PR checks / artifacts).

Screenshots

gpt-5.6-sol completing scoped work and recording the out-of-scope TODO as a live suggested-task card

gpt-5.6-sol completing scoped work and recording the out-of-scope TODO as a live suggested-task card

…calibrated guidance

- forward taskSuggestionDeliveryMode through the Codex app-server dynamic tool build (same sibling-harness omission class previously fixed for clientCaps); spawn_task/dismiss_task silently never existed for GPT-backed sessions
- regression test asserting the forward, mirroring the existing clientCaps case
- spawn_task/dismiss_task descriptions rewritten with usage calibration: when to flag, when not to, scope-vs-flagging, prose-is-lost, operator-phrasing bridge, prompt self-containment, git-checkout cwd, registry ephemerality; param descriptions state where each field renders

Release-note context: GPT-backed sessions can now create suggested-task cards (the tools were silently absent on the Codex harness), and the tools carry much clearer model-facing guidance.
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 10, 2026 11:04
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling extensions: codex size: XS maintainer Maintainer-authored PR labels Aug 10, 2026
@steipete
steipete merged commit c3f4d5e into main Aug 10, 2026
182 of 184 checks passed
@steipete
steipete deleted the steipete/spawn-task-tool-guidance branch August 10, 2026 11:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 11, 2026
…calibrated guidance (openclaw#121568)

- forward taskSuggestionDeliveryMode through the Codex app-server dynamic tool build (same sibling-harness omission class previously fixed for clientCaps); spawn_task/dismiss_task silently never existed for GPT-backed sessions
- regression test asserting the forward, mirroring the existing clientCaps case
- spawn_task/dismiss_task descriptions rewritten with usage calibration: when to flag, when not to, scope-vs-flagging, prose-is-lost, operator-phrasing bridge, prompt self-containment, git-checkout cwd, registry ephemerality; param descriptions state where each field renders

Release-note context: GPT-backed sessions can now create suggested-task cards (the tools were silently absent on the Codex harness), and the tools carry much clearer model-facing guidance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling extensions: codex maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant