Skip to content

fix(agents): read the published model catalog owner from session_status - #130277

Merged
VACInc merged 1 commit into
openclaw:mainfrom
VACInc:fix/read-only-catalog-published-owner
Aug 26, 2026
Merged

VACInc merged 1 commit into
openclaw:mainfrom
VACInc:fix/read-only-catalog-published-owner

Conversation

@VACInc

@VACInc VACInc commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

session_status fails with prepared model catalog owner config was replaced during the read (<agentDir>) whenever the Gateway has republished its runtime config since the current run was admitted (config edit, skills hot-reload, plugin reload). The tool passes the run's captured cfg to loadPreparedModelCatalog({ readOnly: true }), which resolves the owner under the exact config policy and throws on any generation mismatch. Nothing retries, so the model gets a hard tool error for the rest of that run.

Seen 18 times in one operator's transcripts (Aug 2–26, 2026): session_status, nested session_status from code mode, and sessions_spawn.

Why This Change Was Made

session_status is a turn-path read that wants the currently published catalog generation, not a catalog prepared from a stale run snapshot. The module already exposes that contract as loadPublishedPreparedModelCatalog (the same owner the Gateway uses after a config reload, #112026). The tool's three read-only reads now use it; no new fallback path.

Related: #127284 applies the same tolerance to the thinking-catalog lookup. sessions_spawn (src/agents/subagents/spawn/subagent-spawn-child-plan.ts) hits the same class and is left as a follow-up.

User Impact

session_status keeps working after a mid-run Gateway config republish instead of erroring until the next run.

Evidence

  • src/agents/openclaw-tools.session-status.test.ts mock now makes the exact loader throw the replaced-config error and serves the catalog from the published loader; the suite fails on main and passes with the fix (75 passed).
  • Production LOC: +1 / -1 (import) plus three call-site renames.

Worked on by:

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

@VACInc
VACInc marked this pull request as ready for review August 26, 2026 18:05
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Aug 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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, 3:55 PM ET / 19:55 UTC.

ClawSweeper review

What this changes

The PR makes session-status model validation and status-card catalog reads use the Gateway’s currently published model-catalog generation after a configuration republish.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main still uses the exact catalog-owner read that rejects a replaced config; this PR switches the three session-status reads to the established published-owner contract. The branch is behind main and needs a rebase plus exact-head CI before merge.

Priority: P2
Reviewed head: c866eda9de4293d66b0a0d6fbc953007312a9f68

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-neutral repair follows an existing lifecycle contract and has credible regression coverage, pending rebase and exact-head CI.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository context marks this as a MEMBER-authored PR, so the external-contributor real-proof gate does not apply; the stated focused test remains supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository context marks this as a MEMBER-authored PR, so the external-contributor real-proof gate does not apply; the stated focused test remains supplemental evidence.
Evidence reviewed 6 items Current-main failing owner policy: Current main sends all three session-status catalog reads through the exact loader, whose config policy rejects a snapshot whose config no longer matches the caller input.
Published-owner contract: The catalog owner explicitly treats the published policy as accepting the committed snapshot without config equality, while the exact policy requires equality; the exported published loader projects that committed catalog's entries.
Existing owner-boundary tests: Current tests already prove that exact read-only catalog access rejects a replaced configuration and that the published loader returns the replacement owner's catalog.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

$ node scripts/run-node.mjs --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 113.29 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.8s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 15.3s
[plugin-control-plane-loads] verified 36 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4472ms (slowest: built plugin control-plane loads 3685ms)

OpenClaw 2026.8.1 (c866eda) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console (silent|fatal|error|warn|info|debug|trace)
  --no-color           Disable ANSI colors
  --profile ‹name›     Use a named profile (iso
… output truncated …

Assertions:

  • PASS expect_output: Usage: openclaw [options] [command]

How this fits together

Session status is an agent tool that reads session configuration and model-catalog facts to return a diagnostic status card or apply a model override. It receives the admitted run configuration and then consults the lifecycle-owned catalog before producing the tool result.

flowchart LR
A[Admitted agent run] --> B[Session status tool]
B --> C[Session and model request]
C --> D[Catalog owner lookup]
D --> E[Published catalog generation]
E --> F[Status card or model update]
G[Gateway config republish] --> E
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; rebase and exact-head CI must confirm the narrow substitution still integrates cleanly.
  • Complete next step (P2) - No repair lane is needed: the branch already contains the narrow fix; the remaining action is rebase and exact-head CI review.
Agent review details

Security

None.

PR surface

Source 0, Tests +5. Total +5 across 2 files.

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

Review metrics

Metric Value Why it matters
Production versus test LOC production +0 net (4 substitutions); tests +5 net The repair reuses the existing published-owner API without growing production behavior, while the test mock covers the replaced-config fault.

Root-cause cluster

Relationship: canonical
Canonical: #130277
Summary: This PR is the canonical repair for session-status reads after a catalog-owner replacement; the related work shares the lifecycle race but has different callers.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase onto current main, retain the three published-owner reads, and land once the focused agent-runtime checks pass on the rebased head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase onto current main, retain the three published-owner reads, and land once the focused agent-runtime checks pass on the rebased head.

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

Yes—source establishes the path: current main uses the exact loader, which rejects a replacement generation, while the existing catalog tests establish the replacement condition. The focused session-status test was not executed in this read-only review.

Is this the best way to solve the issue?

Yes. The PR reuses the catalog module’s explicit published-owner contract rather than adding a retry or fallback, covering each affected session-status read.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: A configuration republish can make an existing agent diagnostic/model-update tool fail for the remainder of a run, but the affected path is bounded.
  • 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: The repository context marks this as a MEMBER-authored PR, so the external-contributor real-proof gate does not apply; the stated focused test remains supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the catalog policy and affected session-status calls to Peter Steinberger; history includes the published-owner refactor. (role: current implementation and lifecycle-design contributor; confidence: high; commits: f498727bbdad, af588720525e, 7a8eee4a363b; files: src/agents/prepared-model-catalog.ts, src/agents/tools/session-status-tool.ts)
  • joshavant: Recent prepared-catalog maintenance covers read-only owner behavior and catalog discovery boundaries adjacent to this change. (role: recent prepared-catalog contributor; confidence: high; commits: e34fd3016b71, d83f7b815db7, 0b3e11d01a77; files: src/agents/prepared-model-catalog.ts)

Rank-up moves

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

  • Rebase onto current main and confirm the focused agent-runtime and preflight checks pass on the new 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-26T18:12:18.873Z sha 5aa47b65ab0a49f05f5002e18f3057092fd56252 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-26T18:55:59.342Z sha 5aa47b65ab0a49f05f5002e18f3057092fd56252 :: needs maintainer review before merge. :: none

@roboclaw-bot
roboclaw-bot force-pushed the fix/read-only-catalog-published-owner branch from 5aa47b6 to c866eda Compare August 26, 2026 19:49
@roboclaw-bot

roboclaw-bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Land-ready refresh:

  • Rebased onto main (a868258156) and force-pushed exact head c866eda9de.
  • ClawSweeper's legitimate actionable item (rebase + exact-head CI refresh) is handled. Its review found no concrete patch or security defect; the documented sessions_spawn follow-up uses a different scoped-live-discovery path and is not a mechanical omission from this patch.
  • Production delta remains net zero (four loader substitutions); tests are +5 net.

Verification:

  • Regression hunk against current main: FAIL as expected at src/agents/tools/session-status-tool.ts:1133 with prepared model catalog owner config was replaced during the read; 75 tests skipped after suite setup failed.
  • pnpm test src/agents/openclaw-tools.session-status.test.ts: PASS (75/75) on c866eda9de.
  • git diff --check origin/main...HEAD: PASS.
  • pnpm check:changed: formatting, guards, dependency checks, boundaries, and dead-export scans passed; the shared local host killed the core typecheck with exit 137 under memory contention. Exact-head CI closes that local proof gap.
  • Exact-head CI run 33007175094: GREEN.

No behavior-changing push followed the fresh ClawSweeper review, so its documented mechanical-rebase exemption applies and no re-review was requested.

Post-green drift note: main advanced to 281464f824 while the full matrix ran. git merge-tree --write-tree --messages origin/main HEAD is clean with no conflicts. Per the repository rule to stop chasing moving main after one green run plus clean rebase sanity, this already-green head was not churned through another full matrix; maintainers can perform the final landing refresh.

@VACInc
VACInc enabled auto-merge (squash) August 26, 2026 23:45
@VACInc
VACInc merged commit 8587020 into openclaw:main Aug 26, 2026
250 checks passed
vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (26 commits)
  fix(plugins): preserve registry epoch on activation rollback (#129232)
  refactor(plugins): make discovery invocation-owned (#130486)
  feat(ui): save appearance preferences per user profile (#130340)
  fix: Buzz bots recover relay stalls and reject revoked senders (#130467)
  fix(code-mode): serialize catalog handles nested in final values (#130276)
  fix(webchat): CLI skill and harness-injected turns render as operator-sent messages (#130427)
  fix(agents): read the published model catalog owner from session_status (#130277)
  fix(channels): preserve long presentation text (#130368)
  fix(agents): route CLI bootstrap truncation notice into the system prompt (#130325)
  refactor(plugins): unify setup registration and artifact selection (#130474)
  fix(memory): prevent forgotten session content from returning (#130451)
  refactor(outbound): consolidate transport completion (#130460)
  fix(workers): protect in-flight workspace manifests from concurrent retention (#130449)
  fix(portals): keep worker previews reachable and owned by the active environment (#130434)
  fix(config): keep core channels keys in the generated config schema (#120736)
  chore(deps): refresh dependencies after seven-day cooldown (#130296)
  fix(agents): remind exec models to quote shell metacharacters (#125485)
  fix(auth): honor shared-store ownership in temp-state exec and agent deletion (#130437)
  fix(openshell): preserve file writes during concurrent mirror commands (#130447)
  fix(workers): report full nodes as at capacity, not offline (#130445)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
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 P2 Normal backlog priority with limited blast radius. 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.

2 participants