Skip to content

feat: steer mid-turn prompts by default#77023

Merged
steipete merged 17 commits into
openclaw:mainfrom
fuller-stack-dev:codex/default-midturn-steering
May 13, 2026
Merged

feat: steer mid-turn prompts by default#77023
steipete merged 17 commits into
openclaw:mainfrom
fuller-stack-dev:codex/default-midturn-steering

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make steer the clear default active-run queue mode: normal inbound messages try to enter the active run instead of always waiting for a later turn.
  • Preserve the explicit queue-by-default modes people can choose: followup queues each message for later, collect coalesces compatible queued messages for one later turn, and interrupt aborts the active run for the newest message.
  • Harden explicit /steer <message> so user text is never swallowed: if same-turn steering is unavailable, rejected, compacting, idle, or throws, OpenClaw strips /steer and continues with <message> as a normal prompt.
  • Remove overlapping legacy queue mode names from the public config surface while migrating them safely: queue -> steer, steer-backlog / steer+backlog -> followup.
  • Update schema/help/generated config docs, queue docs, slash-command docs, changelog, and targeted queue/steer regression coverage.

Before

  • Active-run queue behavior had overlapping modes: steer, legacy queue, followup, collect, steer-backlog, and interrupt.
  • queue meant serialized steering, while steer meant batched steering; the distinction was implementation-shaped and hard to explain.
  • steer-backlog both steered and preserved the same message for a later followup, which could look like duplicate handling on streaming surfaces.
  • /steer <message> depended on same-turn steering succeeding; some fallback paths could leave the command body in an unsafe/unclear state instead of reliably treating <message> as a normal prompt.
  • The docs and PR text over-framed followup/collect as fallback behavior, which made it unclear whether users could still queue by default.

After

  • Supported queue modes are intentionally small and user-facing:
    • steer: default. Try to inject normal inbound messages into the active run; if the runtime cannot accept steering, wait for the active run to finish and run the prompt later.
    • followup: do not steer; queue each message for a later turn after the active run ends.
    • collect: do not steer; queue compatible messages and run one coalesced later turn after the quiet window.
    • interrupt: abort the active run and start the newest message.
  • /queue steer controls future normal inbound messages. /steer <message> is an explicit one-off command and works independently of the stored /queue mode.
  • /steer <message> never drops the message text: when steering cannot happen, <message> continues as a normal prompt.
  • Existing configs using retired names keep working through doctor/config migration.

Verification

  • pnpm test src/auto-reply/reply/queue/settings.test.ts src/auto-reply/reply.directive.parse.test.ts src/auto-reply/reply/directive-handling.queue-validation.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/agent-runner.media-paths.test.ts src/commands/doctor/shared/legacy-config-migrate.test.ts src/config/config-misc.test.ts src/config/schema.help.quality.test.ts src/config/config.legacy-config-detection.accepts-imessage-dmpolicy.test.ts src/auto-reply/reply/commands-steer.test.ts src/auto-reply/reply/get-reply-inline-actions.skip-when-config-empty.test.ts src/auto-reply/reply/get-reply.before-agent-reply.test.ts
  • pnpm config:schema:check
  • pnpm config:docs:check
  • pnpm format:docs:check
  • git diff --check
  • Testbox pnpm check:changed: run 25785282586 / tbx_01krg496nw9zq7axbjvywtcfsh, passed.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: L labels May 4, 2026
@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The PR makes normal mid-run prompts attempt same-turn steering by default, narrows /queue to fallback modes, updates Codex steering batching and /steer fallback handling, and refreshes related docs/tests/changelog.

Reproducibility: not applicable. this is a feature/config-surface PR, not a bug report. Source comparison shows current main still has the old steering-mode surface while the PR head implements the new default behavior.

Real behavior proof
Needs real behavior proof before merge: The PR body claims a live gateway smoke, but no inspectable terminal output, logs, screenshot, recording, or linked artifact is attached; the contributor should add redacted proof to the PR body and request re-review if it does not trigger automatically. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, ask a maintainer to comment @clawsweeper re-review.

Next step before merge
Human/contributor action is needed for redacted real behavior proof and maintainer acceptance of the default-steering product/config change; automation cannot supply the contributor's live setup proof.

Security
Cleared: The diff changes queue runtime behavior, config/schema/docs, doctor migrations, tests, and changelog without adding dependencies, CI execution, secrets handling, or package-resolution changes.

Review findings

  • [P2] Update the Codex harness queue docs — src/config/zod-schema.core.ts:455-457
Review details

Best possible solution:

Land the central queue/runtime/schema migration only after the stale Codex harness docs are corrected, maintainers accept the default-steering behavior, and redacted real Telegram or gateway proof plus appropriate broad validation is attached.

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

Not applicable: this is a feature/config-surface PR, not a bug report. Source comparison shows current main still has the old steering-mode surface while the PR head implements the new default behavior.

Is this the best way to solve the issue?

Mostly yes, but not merge-ready: the PR changes the central queue resolver, runtime steering path, schema, doctor migration, and tests rather than a channel-specific workaround. It still needs the stale Codex harness docs fixed, real behavior proof, broad validation, and maintainer product approval.

Full review comments:

  • [P2] Update the Codex harness queue docs — src/config/zod-schema.core.ts:455-457
    After this PR removes steer and queue from the public queue schema, docs/plugins/codex-harness-runtime.md still says the default is messages.queue.mode: "steer" and that legacy queue sends separate turn/steer requests. That page would publish invalid config guidance after merge, so update it with the same automatic-steering/fallback wording as the queue docs.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.88

Acceptance criteria:

  • pnpm test src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/agent-runner.media-paths.test.ts src/auto-reply/reply/queue/settings.test.ts src/auto-reply/reply/queue-policy.test.ts src/agents/subagent-announce-delivery.test.ts src/agents/subagent-announce.test.ts extensions/codex/src/app-server/run-attempt.test.ts src/agents/pi-embedded-runner/runs.test.ts src/auto-reply/reply.directive.parse.test.ts src/auto-reply/reply/directive-handling.queue-validation.test.ts
  • pnpm config:schema:check
  • pnpm config:docs:check
  • pnpm format:docs:check
  • git diff --check upstream/main...HEAD

What I checked:

Likely related people:

  • steipete: Current-main history ties the default queue mode, batched active steering, and active-run queue failure handling to this person across the central files. (role: feature/history owner and recent queue maintainer; confidence: high; commits: 4a6e10ece842, 30a2b3049ae0, 1ed50b0ced62; files: src/auto-reply/reply/queue/settings.ts, src/agents/pi-embedded-runner/runs.ts, src/auto-reply/reply/agent-runner.ts)
  • vincentkoc: Recent current-main work touched embedded-runner import/lifecycle behavior near the active-run paths affected by this PR. (role: adjacent active-run contributor; confidence: medium; commits: 4a30ae182b6a; files: src/agents/pi-embedded-runner/runs.ts)
  • kevinslin: Recent current-main Codex harness documentation reorganization makes this person a plausible reviewer for the stale Codex harness runtime page. (role: adjacent Codex docs contributor; confidence: medium; commits: ce0584af89bb; files: docs/plugins/codex-harness-runtime.md)

Remaining risk / open question:

  • The PR still lacks inspectable after-fix proof from a real gateway or Telegram setup.
  • The PR body says changed lanes expanded to broad/all and no Testbox broad gate was run.
  • The default-steering behavior and public queue-mode retirement are product/config-surface changes that need maintainer acceptance.
  • One Codex harness docs page still documents removed queue modes.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 40e8782400f6.

@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label May 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XL triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed size: L labels May 13, 2026
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 13, 2026
@steipete steipete force-pushed the codex/default-midturn-steering branch from ef463c6 to 1495bfb Compare May 13, 2026 06:42
@steipete steipete self-requested a review May 13, 2026 09:47

akrimm702 commented May 13, 2026

Copy link
Copy Markdown
Contributor

Retracting this finding.

Thanks for clarifying in #77023 (comment). I treated active subagent announcements like normal inbound user prompts, but I understand now that these are internal handoffs back into the active requester turn and are intentionally kept on the steering path regardless of followup / collect queue mode.

Given that invariant, my previous P1 is not a blocker. The separate steering acceptance/rejection concern is covered by 9ed10de19c, where announce steering now awaits the async steering outcome before reporting delivery.

@steipete

steipete commented May 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for rechecking. We are intentionally keeping active subagent announcements on the steering path regardless of followup / collect queue mode.

Those queue modes are user-prompt semantics. A subagent announcement is an internal handoff back into the active requester turn, so skipping steering would reintroduce the alternate delivery/queue behavior this PR is meant to remove. I added an inline note at src/agents/subagent-announce-delivery.ts in cdb36ae to make that distinction explicit.

The acceptance/rejection issue from the later review is handled separately in 9ed10de: announce steering now awaits the async steering outcome, so runtime rejection is no longer reported as delivered.

@steipete steipete force-pushed the codex/default-midturn-steering branch from 6eb49b8 to e66c962 Compare May 13, 2026 12:58
@steipete

steipete commented May 13, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification for rebased head e66c9620c2397fe32dcb9f3197564ab98cf5dd62:

  • Rebased on current origin/main (1c5c72ea24c94140d4578fa1e2d90cbcd9be6cfd) and resolved the CHANGELOG.md entry with contributor credit.
  • git diff --check
  • rg -n "^(<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|)" CHANGELOG.md docs src extensions || true
  • pnpm test src/agents/subagent-announce-dispatch.test.ts src/agents/subagent-announce-delivery.test.ts src/agents/pi-embedded-runner/runs.test.ts src/agents/subagent-announce.format.e2e.test.ts src/agents/subagent-announce.test.ts
    • passed: agents shard 71 tests, e2e shard 79 tests
  • pnpm test src/auto-reply/reply/commands-steer.test.ts src/auto-reply/reply/queue/settings.test.ts src/auto-reply/reply/queue-policy.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts extensions/codex/src/app-server/run-attempt.test.ts -- -t "queued steering|explicit all-mode steering|flushes pending default queued steering|rejects queued steering|resolveActiveRunQueueAction|resolveQueueSettings|handleSteerCommand"
    • passed: unit-fast 12 tests, auto-reply filtered 8 tests, Codex app-server filtered 6 tests

GitHub checks on the rebased head:

  • auto-response: passed
  • dispatch: passed
  • dependency-change-awareness: passed
  • label: passed
  • label-issues: passed
  • Real behavior proof: failed only because this external PR body lacks a real-behavior-proof section; local maintainer verification above covers the queue/Codex/subagent behavior touched here, so I’m treating that bot as non-blocking per maintainer policy.

Re-review progress:

@steipete steipete merged commit 70df2b8 into openclaw:main May 13, 2026
22 of 23 checks passed
l3ocifer pushed a commit to l3ocifer/frack-openclaw that referenced this pull request May 13, 2026
Summary:
- Default active-run queueing to steer while preserving explicit followup/collect modes.
- Keep `/steer` fallback behavior and migrate retired queue steering config.
- Await Codex app-server steering acceptance so rejected/aborted steering can fall back safely.
- Route active subagent announcements through intentional acceptance-aware steering, with legacy queue helpers deprecated for delivery decisions.

Verification:
- git diff --check
- rg -n "^(<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|)" CHANGELOG.md docs src extensions || true
- pnpm test src/agents/subagent-announce-dispatch.test.ts src/agents/subagent-announce-delivery.test.ts src/agents/pi-embedded-runner/runs.test.ts src/agents/subagent-announce.format.e2e.test.ts src/agents/subagent-announce.test.ts
- pnpm test src/auto-reply/reply/commands-steer.test.ts src/auto-reply/reply/queue/settings.test.ts src/auto-reply/reply/queue-policy.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts extensions/codex/src/app-server/run-attempt.test.ts -- -t "queued steering|explicit all-mode steering|flushes pending default queued steering|rejects queued steering|resolveActiveRunQueueAction|resolveQueueSettings|handleSteerCommand"

Co-authored-by: fuller-stack-dev <263060202+fuller-stack-dev@users.noreply.github.com>
woodygreen pushed a commit to woodygreen/openclaw that referenced this pull request May 18, 2026
Summary:
- Default active-run queueing to steer while preserving explicit followup/collect modes.
- Keep `/steer` fallback behavior and migrate retired queue steering config.
- Await Codex app-server steering acceptance so rejected/aborted steering can fall back safely.
- Route active subagent announcements through intentional acceptance-aware steering, with legacy queue helpers deprecated for delivery decisions.

Verification:
- git diff --check
- rg -n "^(<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|)" CHANGELOG.md docs src extensions || true
- pnpm test src/agents/subagent-announce-dispatch.test.ts src/agents/subagent-announce-delivery.test.ts src/agents/pi-embedded-runner/runs.test.ts src/agents/subagent-announce.format.e2e.test.ts src/agents/subagent-announce.test.ts
- pnpm test src/auto-reply/reply/commands-steer.test.ts src/auto-reply/reply/queue/settings.test.ts src/auto-reply/reply/queue-policy.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts extensions/codex/src/app-server/run-attempt.test.ts -- -t "queued steering|explicit all-mode steering|flushes pending default queued steering|rejects queued steering|resolveActiveRunQueueAction|resolveQueueSettings|handleSteerCommand"

Co-authored-by: fuller-stack-dev <263060202+fuller-stack-dev@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Summary:
- Default active-run queueing to steer while preserving explicit followup/collect modes.
- Keep `/steer` fallback behavior and migrate retired queue steering config.
- Await Codex app-server steering acceptance so rejected/aborted steering can fall back safely.
- Route active subagent announcements through intentional acceptance-aware steering, with legacy queue helpers deprecated for delivery decisions.

Verification:
- git diff --check
- rg -n "^(<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|)" CHANGELOG.md docs src extensions || true
- pnpm test src/agents/subagent-announce-dispatch.test.ts src/agents/subagent-announce-delivery.test.ts src/agents/pi-embedded-runner/runs.test.ts src/agents/subagent-announce.format.e2e.test.ts src/agents/subagent-announce.test.ts
- pnpm test src/auto-reply/reply/commands-steer.test.ts src/auto-reply/reply/queue/settings.test.ts src/auto-reply/reply/queue-policy.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts extensions/codex/src/app-server/run-attempt.test.ts -- -t "queued steering|explicit all-mode steering|flushes pending default queued steering|rejects queued steering|resolveActiveRunQueueAction|resolveQueueSettings|handleSteerCommand"

Co-authored-by: fuller-stack-dev <263060202+fuller-stack-dev@users.noreply.github.com>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Summary:
- Default active-run queueing to steer while preserving explicit followup/collect modes.
- Keep `/steer` fallback behavior and migrate retired queue steering config.
- Await Codex app-server steering acceptance so rejected/aborted steering can fall back safely.
- Route active subagent announcements through intentional acceptance-aware steering, with legacy queue helpers deprecated for delivery decisions.

Verification:
- git diff --check
- rg -n "^(<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|)" CHANGELOG.md docs src extensions || true
- pnpm test src/agents/subagent-announce-dispatch.test.ts src/agents/subagent-announce-delivery.test.ts src/agents/pi-embedded-runner/runs.test.ts src/agents/subagent-announce.format.e2e.test.ts src/agents/subagent-announce.test.ts
- pnpm test src/auto-reply/reply/commands-steer.test.ts src/auto-reply/reply/queue/settings.test.ts src/auto-reply/reply/queue-policy.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts extensions/codex/src/app-server/run-attempt.test.ts -- -t "queued steering|explicit all-mode steering|flushes pending default queued steering|rejects queued steering|resolveActiveRunQueueAction|resolveQueueSettings|handleSteerCommand"

Co-authored-by: fuller-stack-dev <263060202+fuller-stack-dev@users.noreply.github.com>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Summary:
- Default active-run queueing to steer while preserving explicit followup/collect modes.
- Keep `/steer` fallback behavior and migrate retired queue steering config.
- Await Codex app-server steering acceptance so rejected/aborted steering can fall back safely.
- Route active subagent announcements through intentional acceptance-aware steering, with legacy queue helpers deprecated for delivery decisions.

Verification:
- git diff --check
- rg -n "^(<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|)" CHANGELOG.md docs src extensions || true
- pnpm test src/agents/subagent-announce-dispatch.test.ts src/agents/subagent-announce-delivery.test.ts src/agents/pi-embedded-runner/runs.test.ts src/agents/subagent-announce.format.e2e.test.ts src/agents/subagent-announce.test.ts
- pnpm test src/auto-reply/reply/commands-steer.test.ts src/auto-reply/reply/queue/settings.test.ts src/auto-reply/reply/queue-policy.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts extensions/codex/src/app-server/run-attempt.test.ts -- -t "queued steering|explicit all-mode steering|flushes pending default queued steering|rejects queued steering|resolveActiveRunQueueAction|resolveQueueSettings|handleSteerCommand"

Co-authored-by: fuller-stack-dev <263060202+fuller-stack-dev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation extensions: codex gateway Gateway runtime mantis: telegram-visible-proof Mantis should capture Telegram visible proof. size: XL triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants