Skip to content

fix(gateway): steering messages queue behind active turns - #119287

Merged
fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:codex/fix-embedded-steer-admission-standalone
Aug 4, 2026
Merged

fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:codex/fix-embedded-steer-admission-standalone

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where users steering an active Control UI agent turn would see the message remain queued until the current turn finished when the embedded run was still active but its reply-operation registration had already cleared.

Why This Change Was Made

Gateway-visible turns now reach queue-policy resolution when the active embedded run owns the same current session and no reply operation remains. Non-Gateway turns, stale embedded sessions, and turns with an active reply operation keep the existing admission behavior.

This PR intentionally contains no Control UI, composer, status-indicator, startup, model-catalog, or deployment changes.

User Impact

Steering messages can be injected into the active agent turn after the in-progress tool call completes instead of waiting for the turn to end. Idle messages still start a separate turn.

Evidence

  • Current main red proof at bfba83956f5: 314 tests passed and the new matching-embedded-session regression failed because a competing reply operation was created before queue resolution.
  • Exact PR head 7711e555590: all 315 tests passed in src/auto-reply/reply/dispatch-from-config.test.ts.
  • The three focused cases pass: matching Gateway embedded session, non-Gateway negative control, and stale-session negative control.
  • oxfmt --check, focused oxlint, git diff --check, and autoreview passed.
  • Equivalent production logic was validated live on Wilfred: a steer sent while a tool call was active appeared in the transcript before the tool result, produced the steering acknowledgement immediately after that result, and suppressed the original completion path. An idle follow-up started a distinct turn.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 1:00 PM ET / 17:00 UTC.

ClawSweeper review

What this changes

The PR lets a visible Gateway turn reach queue-policy resolution when its matching embedded run remains active after the reply-operation registration has cleared.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for maintainer review. Its maintainer label and MEMBER author association require human handling, and the review sandbox could not read the repository to complete the required source, history, and scoped-policy checks.

Priority: P2
Reviewed head: 7711e555590e40b23b698e83a239c542477e3cc9
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch and reported regression coverage are useful, but exact-head source and lifecycle-contract review could not be completed in this sandbox.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository MEMBER, so the external-contributor proof gate does not apply; the PR body nevertheless reports a live steering transcript validation.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository MEMBER, so the external-contributor proof gate does not apply; the PR body nevertheless reports a live steering transcript validation.
Evidence reviewed 3 items Protected handling signal: The supplied GitHub context marks this PR maintainer and identifies its author association as MEMBER; repository policy requires it remain open for explicit maintainer handling.
Submitted behavioral coverage: The PR body reports a base-head failing regression and exact-head focused passing coverage for matching embedded sessions plus non-Gateway and stale-session controls.
Inspection infrastructure failure: The required read-only repository inspection could not start because the sandbox returned bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; current-main source, scoped policy, history, and tests were not independently inspected.
Findings None None.
Security None None.

How this fits together

Gateway-visible messages enter the reply dispatcher, which either creates a reply operation or hands the message to the active agent turn’s queue policy. Embedded-run state supplies the active session identity so steering can join that turn without creating a competing reply.

flowchart LR
  A[Gateway-visible message] --> B[Reply dispatcher]
  B --> C[Operation admission]
  C --> D[Embedded run session check]
  D --> E[Queue policy resolution]
  E --> F[Active agent turn]
  F --> G[Steering acknowledgement]
Loading

Decision needed

Question Recommendation
After verifying the embedded-run session and reply-operation lifecycle contracts on the exact head, should this Gateway-only admission exception be accepted? Verify then merge: Review the exact-head owner boundary and focused regression, then merge if matching-session steering is the intended queue-policy contract.

Why: The PR changes active-turn session admission and is marked for maintainer handling; required repository inspection was unavailable, so automated review cannot safely establish the lifecycle invariant.

Before merge

  • Resolve merge risk (P1) - The admission change depends on embedded-run and reply-operation lifecycle semantics that could not be traced through current main; an incorrect ownership match could associate steering with the wrong active session.
  • Complete next step (P2) - A maintainer must review the active-session ownership contract because required repository inspection failed and this PR carries a protected maintainer-handling signal.
Agent review details

Security

None.

PR surface

Source +150. Total +150 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 151 1 +150
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 151 1 +150

Review metrics

Metric Value Why it matters
Production versus test delta production +16/-1, tests +134/-0 The small production admission exception is accompanied by focused regression coverage; the owner-boundary contract still needs exact-head review.

Merge-risk options

Maintainer options:

  1. Verify active-session ownership before merge (recommended)
    Confirm on the exact PR head that the embedded-session resolver and queue policy cannot route a steering message to a stale or different active turn.
  2. Pause for lifecycle-owner review
    Hold the PR if maintainers want a broader decision on where embedded-run and reply-operation ownership is reconciled.

Technical review

Best possible solution:

Complete an exact-head review of the dispatcher, embedded-run session resolver, queue-policy caller, and focused regression before a maintainer decides whether to merge the narrow admission exception.

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

No independent high-confidence reproduction was established because read-only commands could not execute; the PR body reports a focused base-head failure and exact-head pass.

Is this the best way to solve the issue?

Unclear: the proposed matching-session guard is plausibly narrow, but the sandbox failure prevented comparison with the embedded-run resolver, queue-policy owner, and sibling callers.

AGENTS.md: unclear because the file could not be read completely.

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

Labels

Label changes:

  • add P2: This is a bounded, user-visible steering and active-turn behavior repair rather than an availability or data-loss emergency.
  • add merge-risk: 🚨 session-state: The patch changes admission using active embedded-session identity and reply-operation state, so a lifecycle mismatch could mis-associate a steering message.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository MEMBER, so the external-contributor proof gate does not apply; the PR body nevertheless reports a live steering transcript validation.

Label justifications:

  • P2: This is a bounded, user-visible steering and active-turn behavior repair rather than an availability or data-loss emergency.
  • merge-risk: 🚨 session-state: The patch changes admission using active embedded-session identity and reply-operation state, so a lifecycle mismatch could mis-associate a steering message.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository MEMBER, so the external-contributor proof gate does not apply; the PR body nevertheless reports a live steering transcript validation.

Evidence

What I checked:

  • Protected handling signal: The supplied GitHub context marks this PR maintainer and identifies its author association as MEMBER; repository policy requires it remain open for explicit maintainer handling. (7711e555590e)
  • Submitted behavioral coverage: The PR body reports a base-head failing regression and exact-head focused passing coverage for matching embedded sessions plus non-Gateway and stale-session controls. (src/auto-reply/reply/dispatch-from-config.base.test-utils.ts:1226, 7711e555590e)
  • Inspection infrastructure failure: The required read-only repository inspection could not start because the sandbox returned bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; current-main source, scoped policy, history, and tests were not independently inspected.

Likely related people:

  • fuller-stack-dev: The supplied GitHub context identifies this repository member as author of the proposed focused admission change; feature-history ownership could not be inspected because read-only commands failed before execution. (role: current patch author; confidence: low; commits: 7711e555590e; files: src/auto-reply/reply/dispatch-from-config.lifecycle.ts, src/auto-reply/reply/dispatch-from-config.base.test-utils.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Have a maintainer verify the embedded-run session resolver, reply-operation lifecycle, and queue-policy path on the exact head.

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.

@fuller-stack-dev fuller-stack-dev self-assigned this Aug 4, 2026
@fuller-stack-dev
fuller-stack-dev merged commit ed6ee79 into openclaw:main Aug 4, 2026
199 of 207 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the codex/fix-embedded-steer-admission-standalone branch August 4, 2026 18:21
@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(gateway): steering messages queue behind active turns This is item 3/3 in the current shard. Shard 21/38.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

vincentkoc added a commit that referenced this pull request Aug 4, 2026
…fecycle-20260804

* origin/main:
  fix(gateway): steer matching embedded turns (#119287)
vincentkoc added a commit that referenced this pull request Aug 4, 2026
Punchcard-Session: crisp-lantern-orchard-nv

* origin/main: (46 commits)
  perf(agents): reuse provider policy manifest registry (#119305)
  fix(media): roll back partial generated batches (#119292)
  fix(gateway): steer matching embedded turns (#119287)
  fix(telegram): correlate deliveries to explicit topics
  fix(plugins): preserve install index state across failures (#119228)
  test: trim redundant control ui coverage (#119286)
  test: cover missing config method in memory settings
  fix: gate curated config controls by method
  test: cover read-only admin method gates
  fix: keep config drafts on their gateway
  fix: reset agent skill filters with config patch
  refactor: reuse chat error state helper
  test: avoid unbound identity request assertion
  refactor: isolate clawhub skill search
  fix: guard delayed config actions across reconnects
  fix: preserve workshop revisions across session navigation
  refactor: isolate workshop revision handoff
  test: advertise skill action methods in ui e2e
  fix: fail stale workshop revision sends
  fix: bind revision handoffs to gateway snapshots
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
…fecycle-20260804

* origin/main:
  fix(gateway): steer matching embedded turns (openclaw#119287)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant