Skip to content

fix: align update-routing tests with system actor dispatch - #137199

Merged
steipete merged 1 commit into
mainfrom
codex/perf6-update-routing-fixtures
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf6-update-routing-fixtures

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

CI's two update-routing suites reject valid in-process calls because their expected dispatch options omit the explicit system actor added by #136952. This fails four existing cases across the compact check shards.

Why This Change Was Made

Assert the existing operatorRoleActor: { kind: "system" } option in both exact call expectations. Also express the expected trusted thread field directly, matching its producer. The undefined-valued thread key is not a separate defect: the installed matcher ignores such keys.

The system actor is already supplied by the in-process call helper. The dispatcher still retains scoped/inherited operator authority instead of accepting an explicit system actor over it. No production code, authorization policy, mock breadth, call count, timeout or routing assertion changes.

User Impact

Required CI can verify the existing owner-only update flow again. Production LOC is unchanged; test LOC is +3/−1 (net +2). No runtime performance claim is made for this CI repair.

Evidence

All four failures reproduced before editing: one /update case and three Gateway tool routing cases. Afterward, all 31 tests in the two changed suites passed. Another 34 real-dispatch authorization tests and 19 in-process helper tests passed, along with formatting and the complete changed-file gate. Independent managed Codex review found no actionable P0–P2 findings.

The original Linux full-shard execution order was not replayed locally; the focused suites exercise the same deterministic argument mismatch. No real Gateway self-update was invoked for this test-only repair. Current archive and open-PR searches found no competing fix after one preserved transient search failure.

@steipete
steipete marked this pull request as ready for review September 3, 2026 08:43
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 4:52 AM ET / 08:52 UTC.

ClawSweeper review

What this changes

This PR updates two update-routing tests to expect the system actor and producer-owned thread field already sent by in-process Gateway dispatch.

Merge readiness

✅ Ready for maintainer review

Keep open. The two introduced assertions accurately match the existing in-process update dispatch contract; no correctness or security defect was found.

Priority: P3
Reviewed head: 2bc689928cc64e0c775d7e9e2d4e47131f4861e3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, production-aligned test repair with no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only PR changes no production behavior; the provided focused test results are supplemental validation rather than a required user-flow proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test-only PR changes no production behavior; the provided focused test results are supplemental validation rather than a required user-flow proof.
Evidence reviewed 5 items Shared dispatch contract: The in-process helper always supplies a system operator actor when it dispatches a bound Gateway request, so both updated expectations reflect production behavior.
Gateway-tool caller: The owner-only Gateway tool builds trusted delivery context and delegates update.run to the in-process helper rather than constructing its own client options.
Chat-command caller: The /update handler independently uses the same in-process helper with its admitted Gateway-context resolver, so its assertion needs the same actor field.
Findings None None.
Security None None.

How this fits together

The Gateway tool and the chat /update command send owner-authorized update requests through the in-process Gateway helper. That helper constructs the trusted synthetic client and sends the request to the Gateway update handler; these tests protect those routing arguments.

flowchart LR
  A[Owner update request] --> B[Gateway tool or chat command]
  B --> C[In-process Gateway helper]
  C --> D[System actor and scoped client]
  D --> E[Gateway update handler]
  E --> F[Update result and reply]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +2. Total +2 across 2 files.

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

Review metrics

Metric Value Why it matters
Production versus test LOC production +0, tests +2 net The patch is confined to existing test expectations and does not alter the update or authorization runtime.

Technical review

Best possible solution:

Keep the direct system-actor and thread-field expectations so both update entry points continue to detect dispatch-contract drift.

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

Yes—source inspection reproduces the deterministic expectation mismatch: current production dispatch adds the system actor while the current-main test expectations omit it.

Is this the best way to solve the issue?

Yes. Reusing the helper’s actual argument contract in both caller-level tests is the narrowest maintainable repair and adds no parallel behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a focused test-only CI repair with no introduced production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test-only PR changes no production behavior; the provided focused test results are supplemental validation rather than a required user-flow proof.

Label justifications:

  • P3: This is a focused test-only CI repair with no introduced production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test-only PR changes no production behavior; the provided focused test results are supplemental validation rather than a required user-flow proof.

Evidence

What I checked:

  • Shared dispatch contract: The in-process helper always supplies a system operator actor when it dispatches a bound Gateway request, so both updated expectations reflect production behavior. (src/agents/tools/in-process-gateway.ts:299, 32bb94ee8467)
  • Gateway-tool caller: The owner-only Gateway tool builds trusted delivery context and delegates update.run to the in-process helper rather than constructing its own client options. (src/agents/tools/gateway-tool.ts:153, 32bb94ee8467)
  • Chat-command caller: The /update handler independently uses the same in-process helper with its admitted Gateway-context resolver, so its assertion needs the same actor field. (src/auto-reply/reply/commands-update.ts:18, 32bb94ee8467)
  • Introduced test-only patch: The verified merge-base-to-head delta changes only the two expectations: it adds the system actor in both and represents the producer's thread property directly in the Gateway-tool case. (src/agents/tools/gateway-tool.test.ts:144, 2bc689928cc6)
  • Prior merged routing work: Local history and the supplied related-item context identify the merged update-routing work as the relevant prior change; it is a routing candidate, not verified source-line introduction attribution. (08c80feb35fd)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 590ee37 into main Sep 3, 2026
165 of 174 checks passed
@steipete
steipete deleted the codex/perf6-update-routing-fixtures branch September 3, 2026 09:00
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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