Skip to content

feat(agents): allow spawn fast mode overrides#82148

Open
jai wants to merge 3 commits into
openclaw:mainfrom
jai:jaig-codex/fastmode-sessions-spawn
Open

feat(agents): allow spawn fast mode overrides#82148
jai wants to merge 3 commits into
openclaw:mainfrom
jai:jaig-codex/fastmode-sessions-spawn

Conversation

@jai

@jai jai commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add fastMode override support to sessions_spawn
  • persist the override before first native subagent or ACP child turn
  • document fast-mode override behavior for subagents, ACP agents, and thinking config

Real behavior proof

  • Behavior or issue addressed: sessions_spawn now accepts an explicit fastMode override so native subagent and ACP child launches can opt out of inherited fast-mode defaults before the first child turn.
  • Real environment tested: Jai macOS OpenClaw workspace, local OpenClaw checkout on branch jaig-codex/fastmode-sessions-spawn, commit 32124e878a, with the live Codex CLI/OpenClaw agent environment used for FINN PR maintenance smoke runs.
  • Exact steps or command run after this patch:
    git show --stat --oneline --show-signature HEAD
    pnpm test src/agents/tools/sessions-spawn-tool.test.ts src/agents/subagent-spawn.test.ts src/agents/acp-spawn.test.ts
    pnpm tsgo:core
    pnpm tsgo:core:test
    DOCS_I18N_GLOSSARY_BASE=upstream/main pnpm check:docs
    pnpm exec oxfmt --check CHANGELOG.md docs/tools/acp-agents.md docs/tools/subagents.md docs/tools/thinking.md src/agents/acp-spawn.ts src/agents/acp-spawn.test.ts src/agents/subagent-spawn.ts src/agents/subagent-spawn.test.ts src/agents/tools/sessions-spawn-tool.ts src/agents/tools/sessions-spawn-tool.test.ts
    git diff --check upstream/main...HEAD
  • Evidence after fix:
    32124e878a Good "git" signature for [email protected] with ED25519 key SHA256:onDicHNVFRcetP9JVw5fHOo+HHRegbUSxEiJbEB9DzU
    feat(agents): allow spawn fast mode overrides
     CHANGELOG.md                                 |  1 +
     docs/tools/acp-agents.md                     |  5 +++++
     docs/tools/subagents.md                      |  4 ++++
     docs/tools/thinking.md                       |  2 +-
     src/agents/acp-spawn.test.ts                 |  2 ++
     src/agents/acp-spawn.ts                      |  2 ++
     src/agents/subagent-spawn.test.ts            |  2 ++
     src/agents/subagent-spawn.ts                 |  5 +++++
     src/agents/tools/sessions-spawn-tool.test.ts | 18 ++++++++++++++++++
     src/agents/tools/sessions-spawn-tool.ts      |  9 +++++++++
    16 files changed, 73 insertions(+), 13 deletions(-)
    
    pnpm test src/agents/tools/sessions-spawn-tool.test.ts src/agents/subagent-spawn.test.ts src/agents/acp-spawn.test.ts -> 102 passed
    pnpm tsgo:core -> passed
    pnpm tsgo:core:test -> passed
    DOCS_I18N_GLOSSARY_BASE=upstream/main pnpm check:docs -> passed
    pnpm exec oxfmt --check ... -> passed
    OPENCLAW_ADDITIONAL_BOUNDARY_SHARD=1/4 OPENCLAW_ADDITIONAL_BOUNDARY_CONCURRENCY=4 node scripts/run-additional-boundary-checks.mjs -> passed
    git diff --check upstream/main...HEAD -> passed
    
  • Observed result after fix: The patched source persists fastMode: false onto the child session before native subagent and ACP child turns start; the focused tests cover the tool payload path, native subagent spawn path, and ACP spawn path.
  • What was not tested: I did not deploy this branch into production OpenClaw; this proof is from the local patched OpenClaw checkout plus the live agent environment used to validate the fast-off launch behavior.

Validation

  • pnpm test src/agents/tools/sessions-spawn-tool.test.ts src/agents/subagent-spawn.test.ts src/agents/acp-spawn.test.ts
  • pnpm tsgo:core
  • pnpm tsgo:core:test
  • DOCS_I18N_GLOSSARY_BASE=upstream/main pnpm check:docs
  • pnpm exec oxfmt --check CHANGELOG.md docs/tools/acp-agents.md docs/tools/subagents.md docs/tools/thinking.md src/agents/acp-spawn.ts src/agents/acp-spawn.test.ts src/agents/subagent-spawn.ts src/agents/subagent-spawn.test.ts src/agents/tools/sessions-spawn-tool.ts src/agents/tools/sessions-spawn-tool.test.ts
  • OPENCLAW_ADDITIONAL_BOUNDARY_SHARD=1/4 OPENCLAW_ADDITIONAL_BOUNDARY_CONCURRENCY=4 node scripts/run-additional-boundary-checks.mjs
  • git diff --check upstream/main...HEAD

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 15, 2026
@clawsweeper

clawsweeper Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 8:52 PM ET / July 1, 2026, 00:52 UTC.

Summary
The PR adds a fastMode parameter to sessions_spawn, threads it through native subagent and ACP runtime initialization, and updates docs, tests, prompt snapshots, and changelog text.

PR surface: Source +51, Tests +73, Docs +11. Total +135 across 21 files.

Reproducibility: not applicable. This PR adds a new model-facing spawn capability rather than fixing a reproduced current-main bug. The blockers are source-review findings against the PR diff and current-main contracts.

Review metrics: 1 noteworthy metric.

  • Fast-mode API surfaces: 1 model-facing tool parameter added, 1 ACP runtime option/config alias added. These surfaces affect provider fast-tier routing and need compatibility review against the existing FastMode contract before merge.

Stored data model
Persistent data-model change detected: persistent cache schema: CHANGELOG.md, serialized state: src/agents/tools/sessions-spawn-tool.test.ts, serialized state: src/agents/tools/sessions-spawn-tool.ts, unknown-data-model-change: src/agents/tools/sessions-spawn-tool.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Rebase and resolve the current dirty/conflicting branch state against main.
  • Use the shared FastMode/normalizeFastMode contract for sessions_spawn and ACP runtime options, with tests for false, on, and auto.
  • [P1] Add redacted real native or ACP child-spawn proof showing the first child turn starts with the requested fast-mode state.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body shows tests and source observations, but no redacted runtime log, transcript, recording, terminal output, or linked artifact shows a real native or ACP child spawn starting with the requested fast-mode state; private details should be redacted, and updating the PR body should trigger re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The new same-name fastMode surfaces are boolean-only while current main and v2026.6.11 support true, false, and "auto", so merging as-is would create a competing contract for spawned sessions.
  • [P1] ACP session/set_config_option inference would turn fast_mode=on and fast_mode=auto into false, potentially routing spawned ACP turns through the wrong provider fast-tier state.
  • [P1] GitHub reports the branch dirty/conflicting, so final review needs a rebase or conflict resolution before maintainers can rely on the patch context.
  • [P1] Contributor proof is still source/test-output based; no observable real native or ACP child-spawn artifact shows the first child turn starting with the requested fast-mode state.

Maintainer options:

  1. Rebase And Preserve FastMode (recommended)
    Resolve conflicts and update sessions_spawn, ACP runtime options, and config-option inference to use the shared FastMode/normalizeFastMode contract with focused false, on, and auto coverage plus real child-spawn proof.
  2. Pause API Direction
    Pause or close this PR if maintainers are not ready to add a new model-facing spawn override that changes child-session provider tier routing.
  3. Accept Boolean-Only Deliberately
    Maintainers could intentionally keep a boolean-only override, but they should rename or document it as distinct from the existing FastMode auto contract and accept the compatibility risk.

Next step before merge

  • [P1] Manual review is needed because contributor-side real behavior proof is missing and maintainers need to confirm the new API/compat shape after the conflicting branch is rebased.

Security
Cleared: Cleared: the diff changes TypeScript source, docs, tests, prompt snapshots, and changelog text without adding workflows, dependencies, lockfiles, secret handling, downloads, or package execution paths.

Review findings

  • [P1] Preserve FastMode values in ACP config inference — src/acp/control-plane/runtime-options.ts:473
  • [P2] Keep sessions_spawn fastMode on the shared contract — src/agents/tools/sessions-spawn-tool.ts:182-187
  • [P3] Drop release-owned changelog edits — CHANGELOG.md:21-28
Review details

Best possible solution:

Rebase onto current main, implement the spawn override on the shared FastMode contract through native and ACP paths, remove release-owned changelog edits, and attach redacted real child-spawn proof before merge.

Do we have a high-confidence way to reproduce the issue?

Not applicable; this PR adds a new model-facing spawn capability rather than fixing a reproduced current-main bug. The blockers are source-review findings against the PR diff and current-main contracts.

Is this the best way to solve the issue?

No, not yet. sessions_spawn is a plausible owner boundary, but the implementation should preserve the shared FastMode contract, resolve conflicts, and prove a real child spawn before merge.

Full review comments:

  • [P1] Preserve FastMode values in ACP config inference — src/acp/control-plane/runtime-options.ts:473
    Current main accepts off/on/auto fast-mode values, but this branch converts every ACP fast_mode value except literal "true" into false. An ACP client or backend setting fast_mode=on or fast_mode=auto would persist standard mode, so this path should use the shared FastMode and normalizeFastMode contract before merge.
    Confidence: 0.93
  • [P2] Keep sessions_spawn fastMode on the shared contract — src/agents/tools/sessions-spawn-tool.ts:182-187
    The new model-facing fastMode parameter uses the same name as the session fast-mode override but only accepts booleans. Current main accepts true, false, and "auto"; a narrower same-name child-spawn contract would confuse callers and block auto at the spawn boundary.
    Confidence: 0.9
  • [P3] Drop release-owned changelog edits — CHANGELOG.md:21-28
    Root policy keeps CHANGELOG.md release-generated, with normal feature PRs carrying release-note context in the PR body or commit message instead. These added entries, including one unrelated to this PR, should be dropped so release generation owns the file.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 44b4a0ac0598.

Label changes

Label justifications:

  • P2: This is a normal-priority agents feature with limited blast radius but real provider-routing and compatibility implications.
  • merge-risk: 🚨 compatibility: The PR introduces boolean-only same-name fastMode surfaces while current main accepts true, false, and "auto".
  • merge-risk: 🚨 auth-provider: Fast mode controls provider service-tier routing, so wrong values can route spawned child turns through the wrong tier state.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body shows tests and source observations, but no redacted runtime log, transcript, recording, terminal output, or linked artifact shows a real native or ACP child spawn starting with the requested fast-mode state; private details should be redacted, and updating the PR body should trigger re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +51, Tests +73, Docs +11. Total +135 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 6 58 7 +51
Tests 11 86 13 +73
Docs 4 12 1 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 156 21 +135

What I checked:

Likely related people:

  • vincentkoc: Recent shipped fast-mode work in v2026.6.11 added the shared FastMode auto contract that this PR needs to preserve. (role: recent fast-mode contract contributor; confidence: high; commits: e085fa1a3ffd; files: packages/normalization-core/src/string-coerce.ts, src/gateway/sessions-patch.ts, src/agents/fast-mode.ts)
  • masatohoshino: Current main blame for the FastMode normalizer and session patch contract points at the grafted main commit that carries the release fast-mode changes. (role: current-main line owner; confidence: medium; commits: 37341a703223; files: packages/normalization-core/src/string-coerce.ts, src/gateway/sessions-patch.ts)
  • steipete: Git history shows the original sessions_spawn tool and many later ACP/subagent spawn and docs changes in this owner boundary. (role: sessions_spawn feature owner; confidence: high; commits: a279bcfeb171, b32a2cadc295, 61000b8e4ded; files: src/agents/tools/sessions-spawn-tool.ts, src/agents/acp-spawn.ts, docs/tools/acp-agents.md)
  • osolmaz: The ACP thread-bound agents work introduced and refactored the ACP control-plane/runtime option boundary that this PR extends. (role: ACP runtime-control contributor; confidence: medium; commits: a7d56e3554d0; files: src/acp/control-plane/runtime-options.ts, packages/acp-core/src/types.ts, src/agents/acp-spawn.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8dd11be0c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/acp-spawn.ts
@jai
jai force-pushed the jaig-codex/fastmode-sessions-spawn branch from 8dd11be to 32124e8 Compare May 15, 2026 13:27
@openclaw-barnacle openclaw-barnacle Bot added size: S proof: supplied External PR includes structured after-fix real behavior proof. and removed size: XS triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 15, 2026
@jai

jai commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

Closing during work-mgmt triage. Will reopen if pursuing upstream contribution.

@jai jai closed this May 19, 2026
@jai jai reopened this May 19, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels May 19, 2026
@jai
jai force-pushed the jaig-codex/fastmode-sessions-spawn branch from 32124e8 to 59aac23 Compare June 6, 2026 03:47
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 6, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@jai thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant