Skip to content

fix: steering reaches active runs across agent harnesses - #119594

Merged
fuller-stack-dev merged 18 commits into
openclaw:mainfrom
fuller-stack-dev:codex/fix-harness-neutral-steering-20260805
Aug 5, 2026
Merged

fuller-stack-dev merged 18 commits into
openclaw:mainfrom
fuller-stack-dev:codex/fix-harness-neutral-steering-20260805

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where users steering an active agent run could have the message rejected as a stale branch before it reached the harness, or lose the message when the active runtime could not accept it immediately. GitHub Copilot runs also exposed steering in the shared UI without injecting the message into the active SDK session.

Why This Change Was Made

Explicit steering is admitted as run-owned input at the shared Gateway boundary. The shared reply operation carries the originating transcript leaf through owner handoff, and moving-leaf admission is allowed only when the exact active owner descends from that leaf. Rejected active-run turns remain queued through the shared auto-reply path.

The Copilot harness injects steering through its SDK session and acknowledges it only after the exact user message is committed to the canonical transcript. Built-in OpenClaw, Codex, and Copilot all consume the same shared admission/lifecycle invariant rather than receiving harness-specific Gateway exceptions.

User Impact

Users can steer active OpenClaw, Codex, and GitHub Copilot runs without a moving transcript leaf dropping the instruction or routing a stale steer into an unrelated run. The composer reports a truthful pending Steering state until receipt.

Evidence

  • Red reproduction on unmodified canonical base: a moving-leaf steer was rejected with active-leaf-changed before the fix.
  • Exact pushed head 8218dd4ce9dc: 748 focused tests passed on Blacksmith Testbox tbx_01kz9xpj9xjypq3ksjtczsvhqm across Gateway admission, exact-owner leaf binding, shared registry/admission, built-in agent runs, shared runner E2E, Control UI, Codex, and Copilot.
  • Root-cause controls include different-owner leaf rejection, no-owner stale rejection, accepted-but-unconfirmed steering, and no replay after accepted steering.
  • pnpm build, pnpm check, git diff --check, changed-surface checks, and two fresh autoreviews passed with no actionable findings.
  • The broad local suite completed with unrelated host/environment failures. The exact failed files were rerun on pristine origin/main 7b8bba26c95 on Testbox: all passed except extensions/file-transfer/src/node-host/file-write.test.ts, which failed identically on main and is outside this PR.
  • Direct dependency proof: Codex maps turn/steer to active-turn pending input in codex-rs/app-server/src/request_processors/turn_processor.rs, codex-rs/core/src/session/mod.rs, and codex-rs/core/src/tasks/mod.rs; the installed Copilot SDK returns the injected user-message identifier from session.send().
  • Earlier Wilfred candidate proof accepted and persisted a stale-original-leaf steer during an active Codex run, returned STEER_ACCEPTED_GREEN, and continued rejecting an ordinary stale send with active-leaf-changed. The exact landed squash SHA will be deployed and re-proven after merge.

This change was implemented with AI assistance.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime extensions: copilot size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 5, 2026, 11:16 AM ET / 15:16 UTC.

ClawSweeper review

What this changes

The PR changes Gateway admission, shared active-run delivery, Copilot steering receipt handling, and Control UI queue wording so active runs receive steering instructions.

Merge readiness

⛔ Blocked by patch quality or review findings - 8 items remain

Keep open: the exact head still admits a stale steering turn when the active owner disappears between Gateway admission and harness injection, so the prior P1 remains unresolved.

Priority: P1
Reviewed head: 7ccfc94370d3e9c9e3fa5d298cfa968cdc436f87
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The PR has useful runtime evidence and broad regression intent, but the unchanged P1 owner-handoff defect makes the patch not ready to merge.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless records an installed after-fix runtime trace and negative control.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless records an installed after-fix runtime trace and negative control.
Evidence reviewed 5 items Unchanged active-owner bypass: The proposed head bypasses expected-leaf validation solely from an instantaneous streaming-registry check. An owner can clear after this check, leaving a stale steering turn eligible for ordinary follow-up dispatch on the advanced branch.
Fallback path does not restore the fence: The reply runner only applies the new rejection-to-follow-up handling after it attempts steering; once the owner has cleared, queue policy falls through before that path runs.
Regression coverage misses the interleaving: The new Gateway case retains the owner until completion, while the reply-runner table fixes the owner as active and streaming; neither clears ownership after admission and before injection.
Findings 1 actionable finding [P1] Preserve stale-leaf fencing through owner handoff
Security None None.

How this fits together

A steering message travels from the chat composer through Gateway admission to the active agent harness, then becomes durable in the canonical transcript. The queue UI must remain pending until that durable receipt, while branch-leaf fencing prevents a stale composer from creating a new turn on a newer branch.

flowchart LR
  User[User steering] --> Gateway[Gateway admission]
  Gateway --> Owner[Active run owner]
  Owner --> Harness[Agent harness]
  Harness --> Transcript[Canonical transcript]
  Transcript --> Queue[Chat queue status]
Loading

Decision needed

Question Recommendation
Should this PR be corrected to retain or revalidate stale-leaf fencing through active-owner handoff before it is merged? Repair the handoff fence: Preserve the expected leaf through steering delivery or revalidate it immediately before the no-owner fallback, with an owner-clear interleaving regression.

Why: The protected maintainer PR has a concrete session-safety defect, but the canonical ownership mechanism—receipt versus pre-fallback revalidation—needs an owner-level choice.

Before merge

  • Preserve stale-leaf fencing through owner handoff (P1) - This remains from the previous review on unchanged code. isStreaming() only snapshots ownership at admission; if that owner advances the leaf and clears before injection, the steer bypasses the leaf guard and the no-owner path can run it as a new turn on the newer branch. Retain the precondition until receipt, or revalidate before fallback dispatch, and add the owner-clear interleaving regression.
  • Resolve merge risk (P1) - Merging as-is can route a stale steering instruction as a fresh follow-up after the active owner advances the transcript and exits.
  • Resolve merge risk (P1) - The Copilot receipt path assumes the SDK send() return value equals the later user.message event identifier; local fakes enforce that equality, but the installed SDK source/types were unavailable for direct contract verification.
  • Resolve merge risk (P1) - The PR asserts preserved native Codex behavior, but the required sibling Codex source was absent from this review environment, so that assertion was not independently verified.
  • Complete next step (P2) - The protected maintainer PR needs an owner-level correction of the exact-head P1 before another merge review.
  • Improve patch quality - Retain or revalidate the expected leaf through owner disappearance and add the focused interleaving regression.
  • Improve patch quality - Provide direct SDK type/source evidence or a runtime trace establishing that Copilot send() returns the identifier used by the transcript event.

Findings

  • [P1] Preserve stale-leaf fencing through owner handoff — src/gateway/server-methods/chat-send-admission.ts:203-205
Agent review details

Security

None.

PR surface

Source +147, Tests +353. Total +500 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 7 162 15 +147
Tests 7 358 5 +353
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 520 20 +500

Review metrics

Metric Value Why it matters
Production versus test delta production +162/-15, tests +358/-5 The production growth implements a cross-harness ownership and transcript-receipt boundary; the added tests must also cover owner disappearance between admission and injection.

Merge-risk options

Maintainer options:

  1. Restore handoff-safe fencing (recommended)
    Make fallback dispatch retain or revalidate the caller’s expected leaf after the active owner clears, and cover that ordering in a focused regression.
  2. Pause this approach
    Do not merge the shared admission bypass if the owner boundary cannot supply a durable receipt or an equivalent revalidation point.

Technical review

Best possible solution:

Carry an owner-bound receipt or the expected-leaf precondition through the owner handoff, and revalidate the leaf before admitting any no-owner fallback turn.

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

Yes, by a focused owner-clear interleaving: admit a stale steer while the owner streams, advance the leaf, clear the owner before injection, and observe fallback dispatch on the newer branch; this read-only review did not execute it.

Is this the best way to solve the issue?

No: the shared owner boundary is the right repair layer, but the proposed instantaneous streaming check is not sufficient because it loses the stale-leaf precondition before fallback dispatch.

Full review comments:

  • [P1] Preserve stale-leaf fencing through owner handoff — src/gateway/server-methods/chat-send-admission.ts:203-205
    This remains from the previous review on unchanged code. isStreaming() only snapshots ownership at admission; if that owner advances the leaf and clears before injection, the steer bypasses the leaf guard and the no-owner path can run it as a new turn on the newer branch. Retain the precondition until receipt, or revalidate before fallback dispatch, and add the owner-clear interleaving regression.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: A user steering an active run can have their instruction silently attached to the wrong transcript branch.
  • merge-risk: 🚨 compatibility: The PR changes shared Gateway admission semantics for existing chat-send clients.
  • merge-risk: 🚨 session-state: It conditionally removes transcript-leaf fencing during active-run ownership.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless records an installed after-fix runtime trace and negative control.

Evidence

What I checked:

Likely related people:

  • fuller-stack-dev: Current-main blame ties the original leaf-fence area to this contributor, and the exact-head bypass is from their steering-hardening commit. (role: recent area contributor; confidence: high; commits: 47ce26985d40, d585181c52ef; files: src/gateway/server-methods/chat-send-admission.ts, src/auto-reply/reply/agent-runner-run.ts)
  • steipete: Local history shows extensive work around the active-run registry and admission area, and the supplied PR timeline records an explicit mention/subscription. (role: adjacent owner; confidence: low; files: src/auto-reply/reply/reply-run-registry.ts, src/gateway/server-methods/chat-send-admission.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-05T12:12:45.716Z sha f3724f0 :: needs changes before merge. :: [P1] Preserve stale-leaf fencing without an active owner | [P1] Gate steering until the initial SDK user event is observed | [P1] Reject receipts for suppressed steering writes
  • reviewed 2026-08-05T13:19:01.493Z sha 7ccfc94 :: found issues before merge. :: [P1] Keep stale-leaf fencing through owner handoff
  • reviewed 2026-08-05T13:26:28.382Z sha 7ccfc94 :: found issues before merge. :: [P1] Preserve stale-leaf fencing through owner handoff

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling extensions: codex size: XL and removed size: L labels Aug 5, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The previous exact-head review run for 8218dd4ce9dca3330e4eefedd0af6950866737d9 failed before generation (review_outcome=skipped). Please retry the fresh exact-head review.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Pre-merge accounting for the latest durable ClawSweeper rank-up moves on the corrected exact head 8218dd4ce9dca3330e4eefedd0af6950866737d9:

  • Owner-handoff stale-leaf fence: addressed at the shared owner boundary by carrying originatingLeafEntryId through the canonical operation lifecycle and allowing the moving-leaf waiver only for the exact active owner descending from that leaf. Owner-clear/no-owner and different-owner interleavings reject instead of falling through as a fresh turn.
  • Adjacent regression proof: included exact-owner acceptance plus no-owner and mismatched-owner negative controls across shared Gateway/reply paths; the final focused matrix passed 748 tests spanning built-in OpenClaw, Codex, Copilot, Gateway, UI, and shared runner behavior.
  • Copilot dependency contract: directly inspected installed @github/copilot-sdk session source and covered validation, exact steering event receipt, and suppressed-write rejection.
  • Codex dependency contract: directly inspected sibling Codex turn steering/interrupt task paths in turn_processor.rs, session/mod.rs, and tasks/mod.rs; OpenClaw uses the shared lifecycle rather than a Codex-only bypass.

The fresh ClawSweeper exact-head run failed before review generation (review_outcome=skipped); one retry is queued but has not dispatched. Guarded scripts/pr-merge verify 119594 passes with no required checks configured. At landing decision time, exact-head hosted CI has 69 successful, 0 failing, with only optional matrix/UI shards pending; focused cross-harness proof and autoreview are clean.

@fuller-stack-dev
fuller-stack-dev merged commit 6d2ba0d into openclaw:main Aug 5, 2026
132 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the codex/fix-harness-neutral-steering-20260805 branch August 5, 2026 22:02
vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 5, 2026
…cope

* origin/main:
  perf(agents): isolate concurrency benchmark workers (openclaw#119749)
  fix(diagnostics): preserve OTEL startup failure (openclaw#119747)
  fix(agents): seed fresh session identity before transcript append (openclaw#119473)
  fix: steering reaches active runs across agent harnesses (openclaw#119594)
  fix(cli): report accurate filtered node totals (openclaw#119744)
  fix(skills): keep installed verdicts scoped to publisher (openclaw#119672)
  fix(diagnostics): honor signal-specific OTLP protocols (openclaw#119708)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
…9594)

* fix steering delivery across harnesses

* fix steering across moving transcript leaves

* test: align steering queue expectations

* fix: harden active steering ownership

* fix: retain steering fallback admission

* fix: reject late copilot steering

* fix: prevent replay of accepted steering

* fix: bind acquired chat work admission

* fix: bind steering to active transcript branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui extensions: codex extensions: copilot gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant