Skip to content

fix(queue): keep system direct-command corrections as followups - #188769

Merged
steipete merged 4 commits into
mainfrom
steipete/fix-1997-system-direct-command-followup
Oct 30, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/fix-1997-system-direct-command-followup

Conversation

@steipete

@steipete steipete commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Related: #188514

What Problem This Solves

Browser corrections to a system-owned direct command were incorrectly steered into that command instead of becoming followup input.

User Impact

System direct commands in a parent conversation retain followup behavior. Owners can still steer active loop/cron executions and visible child sessions, with live incoming authorization and the incumbent's existing execution permissions.

Why This Change Was Made

The owner-guidance exception used a broad native-input attribution helper that also matched completion reports. Qualify scheduled executions and canonical child sessions at the existing continuation boundary instead. The subagent fixture now uses real child identity and parent lineage without invented inter-session provenance; uncapped loop coverage prevents dependence on an optional tool-policy cap. Restore the original direct-command followup expectation, which #188624 changed to steering while this repair was being validated.

Production grows by five lines to distinguish these execution contracts. No new configuration, state, migration, or steering path is added.

Evidence

  • Attribution: the unchanged system direct-command case passes on 14e213feadc2 and fails on 15db8cc635ff with expected 'steered' to be 'followup'. The corrected child fixture also fails on unchanged main with Compatible requester input was dispatched as a separate turn.
  • All 99 focused tests passed: 30 Gateway cases (28 custody plus both direct-command cases), 17 cron cases, 14 prompt-prefix cases, and 38 import-closure/PR-wrapper checks. The serial wrapper took 1266.22s on the loaded local host; Gateway group wall time was 685.34s. These are test costs, not performance measurements.
  • The first tooling attempt exposed an outdated local dependency (fs-safe 0.26.14 versus the lockfile's 0.26.15); a frozen-lockfile install resolved it before the successful run.
  • check:changed --staged --timed: 34 of 35 steps passed, including production types, affected Gateway type graphs, lint, formatting, database guards, import cycles, and all dead-code scans. The remaining test-type graph reports TS2559 at src/sessions/session-controller.message-join.test.ts:591 in a pre-existing uncommitted local edit excluded from this PR. The same error reproduces with this production repair removed; the unrelated file is preserved. The final exact-head PR CI run verified the committed tree successfully.
  • After integrating main 9db820e3174a and restoring the original system-command assertion, both direct-command cases passed again (213.63s Vitest / 235.30s wrapper). Codex autoreview of the complete final diff is scoped-clean through P2, with no actionable findings and successful final source verification.
  • Synthetic Gateway/mock-provider proof. No production runtime was changed or load-tested.

The first PR CI attempt (41137345305, head 98d292159e60) found four net added test lines above the existing ceiling. The fixture was consolidated without removing cases or assertions; net test growth is now zero and no budget/baseline changed. All 28 custody tests passed again (400.47s Vitest / 421.05s wrapper), and refreshed Codex autoreview remained scoped-clean through P2. A local staged full-tree ratchet scan was stopped after ten minutes without a result; the final exact-head CI run passed that check and every required gate.

Final exact-head CI: run 41139718659 succeeded for dcb6d912b1df4f978e52d1bdf6087662bfcf3bba, including all three PostgreSQL conformance shards. Required CI, security, and dependency gates passed; no inherited-failure exception was needed.

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime labels Oct 30, 2026
@steipete
steipete marked this pull request as ready for review October 30, 2026 22:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T22:21:12.016783Z 98d2921 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR keeps browser corrections to system-owned parent commands as followups while preserving owner steering of scheduled and child executions.

Example: An owner sends “Stop waiting and use the corrected approach” while a subagent completion command runs in the parent conversation.

  • Before: The correction joins the system-owned command through the broad owner-guidance exception.
  • After: The correction follows normal requester checks and becomes followup input.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused runtime repair is well supported by source inspection, but a concrete ratchet failure and incomplete authority evidence prevent readiness.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A browser correction can enter a system-owned parent command instead of waiting as the user's followup.
Reason: The maintainer-authored direction preserves distinct parent-command and child-execution contracts without adding configuration or another steering path.

Regression provenance

Regression provenance — verified: source commit 15db8cc635ff by Peter Steinberger; canonical PR #188514 (blame-to-merge-commit).

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: this focused repair addresses current-main misclassification, but its added test lines trigger a blocking budget check.

Priority: P2
Reviewed head: 98d292159e601a84938d150dfc71de752c1b9f0e

Before merge

  • Add real behavior proof - Authority-chain proof required: the supplied Gateway tests construct child execution facts and mock provider I/O; loop cases cover non-owner fallback and post-acceptance revocation, but no capture establishes allowed and nearest-forbidden child-session inputs at final model or tool I/O. Provide redacted terminal output or logs through an isolated Gateway and real execution, keeping credentials and non-public endpoints private. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Keep the test delta nonpositive while the tree exceeds its budget (P2) - The custody fixture grows by four LF lines, with no test-budget change. The reviewed head contains 6,313,404 test lines against a 6,312,358 effective ceiling. scripts/check-test-lines-ratchet.mts only tolerates inherited overage when the PR's test delta is nonpositive, so these four lines turn that inherited condition into a failing check; exact-head CI also identifies test-lines as the failed ratchet. Consolidate at least four test lines while preserving the distinct regressions rather than repairing or allocating the unrelated inherited overage.
  • Resolve security review attention item - No concrete bypass was found, but newly eligible child-session guidance needs final-effect authority validation.
  • Resolve merge risk - The child-session exception newly admits guidance without host-generated input provenance; exclusion of non-admin and revoked callers before final I/O remains unproven on that branch.

Findings

  • [P2] Keep the test delta nonpositive while the tree exceeds its budget — src/gateway/server-methods/chat-send-steering-custody.test.ts:181-183

Tests

  • Missing end-to-end proof: Supply a redacted production-path capture of parent-command followup and child-owner steering, including non-admin and revoked-owner rejection before final I/O.
Agent review details

How this fits together

Gateway chat.send submits corrections to the session controller; reply-tool authority decides whether they join the active execution or retain separate followup custody.

flowchart TD
  A[Browser correction] --> B[Gateway chat send]
  B --> C[Session controller]
  C --> D[Reply authority classification]
  D --> E[Compatible active execution]
  D --> F[Followup queue]
  E --> G[Model and tool execution]
Loading

Technical review

Best possible solution:

Keep the existing classifier repair and regression coverage, make the test delta budget-neutral, and establish the child-session authority boundary.

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

Current main's broad provenance check includes completion reports, and the PR supplies a concrete before/after failing assertion; this review independently inspected the path without executing it.

Is this the best way to solve the issue?

The production change is the smallest complete repair: distinguish scheduled execution provenance and canonical child identity at the existing continuation owner while retaining normal compatibility checks for parent commands.

Full review comments:

  • [P2] Keep the test delta nonpositive while the tree exceeds its budget — src/gateway/server-methods/chat-send-steering-custody.test.ts:181-183
    The custody fixture grows by four LF lines, with no test-budget change. The reviewed head contains 6,313,404 test lines against a 6,312,358 effective ceiling. scripts/check-test-lines-ratchet.mts only tolerates inherited overage when the PR's test delta is nonpositive, so these four lines turn that inherited condition into a failing check; exact-head CI also identifies test-lines as the failed ratchet. Consolidate at least four test lines while preserving the distinct regressions rather than repairing or allocating the unrelated inherited overage.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cf83a69f74ee.

Merge-risk options

Maintainer options:

  1. Verify child-session authority before merge (recommended)
    The PR owner should demonstrate allowed owner guidance and rejection of non-admin and revoked-owner guidance before model or tool I/O through the production owners.

Provenance checked

  • Owner-guidance classification changes intended behavior with a stated reason (15db8cc: Allow authenticated owners to guide active automation while retaining the incumbent execution's permissions.)
  • Cross-transport continuation keeps the original intent (45893d3: Recognize authorized same-session guidance without replacing requester identity or weakening pending-question authority.)
  • System direct-command test expectation changes intended behavior with a stated reason (fc3490a: Align the fixture with compatible reply promotion; this PR explains that system-owned parent commands must first satisfy requester compatibility.)

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete bypass was found, but newly eligible child-session guidance needs final-effect authority validation.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 15db8cc adds src/auto-reply/reply/reply-tool-authority-inbound.ts:82 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 15db8cc635ff; files: src/auto-reply/reply/reply-tool-authority-inbound.ts)
  • Josh Avant: Raw commit 45893d3 adds src/auto-reply/reply/reply-tool-authority-inbound.ts:73 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 45893d3ee45e; files: src/auto-reply/reply/reply-tool-authority-inbound.ts)
  • Paul Bohm: Raw commit f83b7ad adds src/auto-reply/reply/reply-tool-authority-inbound.ts:68 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: f83b7ade15f3; files: src/auto-reply/reply/reply-tool-authority-inbound.ts)

PR surface

Source +5, Tests +4, Docs +5. Total +14 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 8 3 +5
Tests 2 14 10 +4
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 27 13 +14

Labels

Label changes:

  • add P2: The repair concerns bounded steering-versus-followup behavior and has a focused CI correction.
  • add merge-risk: 🚨 security-boundary: The child-session classifier expands eligibility for guidance that retains an incumbent execution's permissions, requiring final-effect authority evidence.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: The repair concerns bounded steering-versus-followup behavior and has a focused CI correction.
  • merge-risk: 🚨 security-boundary: The child-session classifier expands eligibility for guidance that retains an incumbent execution's permissions, requiring final-effect authority evidence.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Add final-effect proof for non-admin child-session guidance and show that owner revocation before consumption prevents model or tool I/O.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 6:37 PM ET / 22:37 UTC.

@steipete
steipete merged commit 4368b27 into main Oct 30, 2026
119 checks passed
@steipete
steipete deleted the steipete/fix-1997-system-direct-command-followup branch October 30, 2026 23:04
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…claw#188769)

* fix(queue): keep system direct-command corrections as followups

* test(queue): restore system direct-command followup contract

* test(queue): keep steering coverage within test budget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS 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