Skip to content

fix(system-agent): normalize route-neutral roster entries - #130370

Merged
RomneyDa merged 3 commits into
mainfrom
fix/system-agent-empty-roster-binding
Aug 31, 2026
Merged

RomneyDa merged 3 commits into
mainfrom
fix/system-agent-empty-roster-binding

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Problem

Maturity run 32992034783 failed the packaged system-agent-first-run Docker lane after the fuzzy planner selected and began openclaw.setup. The first guarded setup write correctly created the default main roster entry, but the next guarded persistent boundary rejected the still-working verified Claude CLI binding and surfaced the generic inference-unavailable message.

The inference-route projection emitted an agent fingerprint whenever an authored agent entry existed, even when that entry contained only route-neutral first-run fields such as default, name, and workspace. The first setup write therefore changed the fingerprint from “no agent projection” to an object whose only relevant value was the already-recorded main id. The model, provider, agent directory, credential, runtime artifact, params, tools, and runtime policy were unchanged.

Repair

Normalize an authored agent entry to absence in the inference fingerprint when it contributes no route-affecting overrides. Entries with agentDir, model, params, tools, relevant model aliases, or agent-runtime overrides remain projected exactly as before. Route identity still independently records the selected agent id and resolved agent directory.

This repairs the fingerprint producer instead of bypassing persistent-boundary revalidation, rebinding after mutation, retrying inference, or weakening the fail-closed authority checks.

Verification

  • New regression proves that adding the workspace-only first-agent roster is inference-route neutral. It fails on pre-fix code (sameDefaultInferenceRoute returns false) and passes after normalization.
  • node scripts/run-vitest.mjs src/system-agent/inference-route.test.ts src/system-agent/verified-inference.test.ts src/system-agent/operations.setup-transaction.test.ts — 55 passed.
  • node scripts/check-changed.mjs -- src/system-agent/inference-route.ts src/system-agent/inference-route.test.ts — passed, including core/core-test typechecks, focused lint, deadcode, database-first, schema, sidecar, and import-cycle guards.
  • Duplicate search found no open PR for the route-neutral roster/frozen-binding defect.
  • The exact Docker lane could not be rerun locally because this host has no Docker executable; the maturity artifact is the real packaged reproduction and the owner-level projection regression is deterministic.

Production LOC: +20/-12 (net +8). Tests: +24/-1 (net +23). The production growth names the route-affecting subset once and removes the previous unconditional projection.

Risk

This touches the system-agent inference authority fingerprint. It deliberately narrows only fields that cannot change inference execution; model/auth/runtime/plugin/agent-dir projections and every persistent-boundary check remain intact. Maintainer/security-owner review is appropriate before merge. No public config, migration, or persistence change. No changelog: internal first-run correctness repair.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 26, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 5:09 PM ET / 21:09 UTC.

ClawSweeper review

What this changes

The PR makes first-run agent roster metadata that cannot affect inference routing absent from the system-agent route fingerprint.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for explicit maintainer review. Current main still fingerprints every authored default agent entry, while first-run setup creates an entry containing name and workspace; the branch corrects that producer-level mismatch without weakening the guarded consumers. The protected maintainer label and unavailable packaged Docker rerun require a human proof decision before merge.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused regression and owner-boundary repair are sound, with one remaining packaged-flow proof decision for maintainers.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its reported Docker run remains useful but was not independently available here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its reported Docker run remains useful but was not independently available here.
Evidence reviewed 7 items Current-main defect: Current main always adds an agent projection whenever the selected agent exists, including entries whose route-affecting fields are all absent.
First-run producer: First-agent creation writes the canonical agent id, name, and workspace, establishing the route-neutral roster state that current main nevertheless fingerprints.
Guarded consumer: Setup captures a default-route projection before live verification and rejects the operation when the projection differs afterward, so the projection is the correct repair owner.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/system-agent/inference-route.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.unit.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130370-RKPR0x/target

 ✓  unit  src/system-agent/inference-route.test.ts (3 tests) 1208ms
     ✓ treats a workspace-only first-agent roster as inference-route neutral  896ms

 Test Files  1 passed (1)
      Tests  3 passed (3)
   Start at  21:10:46
   Duration  25.44s (transform 19.85s, setup 994ms, import 22.88s, tests 1.21s, environment 0ms)

[test] passed 1 Vitest shard in 37.89s
[test] starting test/vitest/vitest.unit.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130370-RKPR0x/target

 ✓  unit  src/system-agent/inference-route.test.ts (3 tests) 1143ms
     ✓ treats a workspace-only first-agent roster as inference-route neutral  871ms

 Test Files  1 passed (1)
      Tests  3 passed (3)
   Start at  21:11:25
   Duration  11.28s (transform 6.10s, setup 450ms, import 9.45s, tests 1.14s, environment 0ms)

[test] passed 1 Vitest shard in 23.82s

Assertions:

  • PASS expect_output: treats a workspace-only first-agent roster as inference-route neutral

How this fits together

System-agent setup verifies an inference route, then compares a route projection before each guarded persistent operation. The projection turns relevant configuration into a stable identity used to decide whether the verified inference binding is still valid.

flowchart LR
  A[Inference verification] --> B[Route projection]
  C[First-agent setup write] --> D[Updated roster]
  D --> B
  B --> E[Guarded route comparison]
  E --> F[Persistent setup operation]
Loading

Decision needed

Question Recommendation
Is the focused projection regression plus exact-head CI sufficient to merge this guarded first-run repair without a fresh packaged Docker first-run run? Accept focused proof: Merge after normal maintainer review because the repair changes only the projection producer and preserves every previously projected route-affecting field.

Why: The branch deliberately changes the identity compared by a persistent inference guard, while the exact package-level scenario was not rerun because Docker was unavailable.

Before merge

  • Resolve merge risk (P1) - The exact packaged Docker first-run scenario was not rerun on this head; the focused regression proves projection equality but not the full packaged recovery.
Agent review details

Security

None.

PR surface

Source +8, Tests +23. Total +31 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 20 12 +8
Tests 1 24 1 +23
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 44 13 +31

Review metrics

Metric Value Why it matters
Production vs test LOC production +8 net; tests +23 net The production growth centralizes the route-affecting subset once; the added test covers the formerly unequal first-agent projection.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the single producer-side normalization and obtain maintainer acceptance of the focused proof or a fresh packaged Docker run; do not relax persistent-boundary revalidation.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the single producer-side normalization and obtain maintainer acceptance of the focused proof or a fresh packaged Docker run; do not relax persistent-boundary revalidation.

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

Yes, from source: current main unconditionally projects an authored agent, while first-agent setup writes only route-neutral roster metadata. The repository also has a packaged Docker reproduction command, though it was not rerun here.

Is this the best way to solve the issue?

Yes. The patch repairs the fingerprint producer rather than bypassing the guarded comparison, and it retains all fields that the previous projection treated as route-affecting.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: A packaged first-run setup can reject a still-valid verified inference binding and block the primary setup operation.
  • 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 MEMBER-authored PR is exempt from the external-contributor proof gate; its reported Docker run remains useful but was not independently available here.

Evidence

What I checked:

Likely related people:

  • Dallin Romney: The available blame attributes the changed projection lines to the active repair commit; deeper parent history was unavailable locally. (role: recent system-agent contributor; confidence: low; commits: c4c49ef9e4ff; files: src/system-agent/inference-route.ts, src/system-agent/inference-route.test.ts)

Rank-up moves

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

  • Optionally run pnpm test:docker:system-agent-first-run on the exact head and attach the redacted successful output.

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 (1 earlier review cycle)
  • reviewed 2026-08-26T20:27:31.738Z sha c4c49ef :: needs maintainer review before merge. :: none

# Conflicts:
#	src/system-agent/inference-route.test.ts
#	src/system-agent/inference-route.ts
@RomneyDa

Copy link
Copy Markdown
Member Author

Refreshed onto current main and resolved the inference-route conflicts at exact head 429e7a5f356547e5c00551989eab87fc49f28c27. The resolution keeps the current route-owner/reserved-agent matrix while retaining the workspace-only first-agent neutrality regression.

Focused proof: node scripts/run-vitest.mjs src/system-agent/inference-route.test.ts — 5/5 passed. git diff --check passed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 29, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Follow-up review found that a setup-materialized default agentDir was still being counted as a route override even though the resolved route already owns that fact. Fixed at exact head 6334f6b6c97: the projection now excludes agentDir, and the regression fixture materializes the actual effective default directory. The strengthened test failed before the fix and now passes; focused suite 5/5 and git diff --check pass.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 29, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Exact head 6334f6b6c97cd6525db3a7bd07b7df31aaa39eb1 is now fully green and mergeable. The preceding exact-review publisher reported that it failed to produce an artifact and would retry via the durable queue. Requesting a fresh review for the post-review behavioral fix.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 29, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Exact packaged proof completed on 6334f6b6c97cd6525db3a7bd07b7df31aaa39eb1 in an isolated clone with its own frozen dependency install:

  • pnpm test:docker:system-agent-first-run
  • package build and tarball integrity passed
  • Docker image built
  • in-container first-run smoke passed
  • terminal result: OpenClaw first-run Docker E2E passed / OK

No credentials or secret-bearing output were included. Exact-head CI is also fully green and the PR is mergeable.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 29, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa
RomneyDa merged commit ee036be into main Aug 31, 2026
236 checks passed
@RomneyDa
RomneyDa deleted the fix/system-agent-empty-roster-binding branch August 31, 2026 04:38
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
…30370)

* fix(system-agent): normalize route-neutral roster entries

* fix(system-agent): ignore materialized agent dir in route projection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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