Skip to content

fix(channels): keep status reads available during state maintenance - #153445

Merged
steipete merged 2 commits into
mainfrom
codex/channels-status-readonly-01a0a39d
Sep 20, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/channels-status-readonly-01a0a39d

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes channels status --probe returning config-only output for a reachable Gateway when another process owns the shared-state lifecycle coordinator.

User Impact

Channel status can return live channel and event-loop evidence while local shared state is busy, without creating a device identity or persisting a returned device token.

Why This Change Was Made

The command selects the existing read-only Gateway-client policy. Authentication, server-side probing, token comparisons, and coordinator ownership keep their current behavior. The integration preserves the shared startup-readiness owner, the 60-second default, and the remaining timeout passed to the channel probe.

Evidence

The original registered-command regression uses a real WebSocket and holds the native coordinator before delivering a hello token. Original code reproduced the persistence error, config-only output without event-loop evidence, zero application RPC calls, and unchanged local state. The corrected command returns the full channel/event-loop payload; read-only gateway call system.info and gateway call channels.status controls also pass.

Fresh integration proof against 2418cf6beccb60ab6b7d8cd62e7728d9b471e778 passed 73 tests across seven files, changed-file type/lint/formatting checks and repository guards, and independent P0–P2 review. The real-process cases keep the explicit 2,000 ms budget and unchanged authentication, coordinator, output, and state-hash assertions. Channel status uses its positive remaining allowance; the direct RPC control keeps exactly 2,000 ms. The existing fractional-clock case verifies that the outer and RPC budgets both equal 3,750 ms while using read-only state.

The fresh negative attempt timed out before authentication and coordinator acquisition, so it does not reproduce the persistence defect. That failed run and the original qualifying regression evidence are retained. No deadlines were increased or retries added. This is isolated local proof; new exact-head hosted CI remains required after publication, and no installed-server performance improvement is claimed.

Release-note context: keep channel-status diagnostics read-only so local state maintenance does not hide reachable Gateway results.

@steipete steipete self-assigned this Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 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.

@steipete
steipete marked this pull request as ready for review September 20, 2026 05:15
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes commands Command implementations size: S maintainer Maintainer-authored PR labels Sep 20, 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 Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 8:24 AM ET / 12:24 UTC (Revision 3).

ClawSweeper review

What this changes

Makes channel-status diagnostics reuse existing device authentication without creating identities or saving returned tokens, with documentation and regression coverage.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on inspected main and the latest release. No actionable correctness or security defect was found; the PR remains a useful landing candidate.

Priority: P2
Reviewed head: 035e1a89387838a920c1c5956874d905129359fd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused integration fix with meaningful process coverage, preserved timeout behavior, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository context identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its body reports successful real-CLI/WebSocket runs under coordinator custody with full status output and unchanged state; the reviewed harness matches that scenario, but this review did not rerun it.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository context identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its body reports successful real-CLI/WebSocket runs under coordinator custody with full status output and unchanged state; the reviewed harness matches that scenario, but this review did not rerun it.
Evidence reviewed 8 items Focused production change: The introduced production change selects the existing read-only client policy. Startup readiness, remaining timeout, probe parameters, output handling, and fallback remain intact.
Existing state-policy owner: The client facade implements read-only credential loading, disables token storage and clearing, and prevents identity creation. The selection does not change server authentication or RPC authorization.
Registered-command regression coverage: The process test uses the real CLI child, WebSocket transport, existing device credentials, and native state coordinator. It acquires custody before returning the hello token, then checks the application RPC, full output, successful exit, and unchanged state bytes; two direct-RPC controls exercise the existing policy.
Findings None None.
Security None None.

How this fits together

The channel-status CLI queries the Gateway for live channel health and falls back to local configuration when the request fails. Its Gateway client also reads device credentials, so unnecessary credential writes can prevent otherwise healthy diagnostics.

flowchart TD
  A[Channel status command] --> B[Gateway startup readiness]
  B --> C[Read-only client authentication]
  D[Existing device credentials] --> C
  C --> E[Gateway channel status request]
  E --> F[Live diagnostic output]
  E --> G[Config fallback on failure]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +179, Docs +2. Total +182 across 5 files.

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

Review metrics

None.

Technical review

Best possible solution:

Keep diagnostics on the existing read-only client lifecycle while preserving Gateway authorization, startup readiness, and live probe output.

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

Yes, source identifies a precise trigger: coordinator custody blocks hello-token persistence before the channel-status RPC. The process regression exercises that sequence; this review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes. Selecting the established read-only client policy is the narrowest repair and avoids duplicating authentication or state-ownership logic.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs misleading config-only diagnostics during local state maintenance without changing channel delivery.
  • 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 supplied repository context identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its body reports successful real-CLI/WebSocket runs under coordinator custody with full status output and unchanged state; the reviewed harness matches that scenario, but this review did not rerun it.

Evidence

What I checked:

  • Focused production change: The introduced production change selects the existing read-only client policy. Startup readiness, remaining timeout, probe parameters, output handling, and fallback remain intact. (src/commands/channels/status.ts:78, 035e1a893878)
  • Existing state-policy owner: The client facade implements read-only credential loading, disables token storage and clearing, and prevents identity creation. The selection does not change server authentication or RPC authorization. (src/gateway/client.ts:124, 035e1a893878)
  • Registered-command regression coverage: The process test uses the real CLI child, WebSocket transport, existing device credentials, and native state coordinator. It acquires custody before returning the hello token, then checks the application RPC, full output, successful exit, and unchanged state bytes; two direct-RPC controls exercise the existing policy. (src/cli/gateway-backed-exit-health.process.test.ts:58, 035e1a893878)
  • Captured validation and review continuity: The supplied PR body reports original before/after process evidence and 73 passing tests after integration. It explicitly distinguishes a later negative run that timed out before reaching the defect. The previous review at this same head contains no findings or published rank-up moves. This read-only review did not execute tests.
  • Current main still needs the fix: At the fetched main revision, channelsStatusCommand still calls the Gateway without sharedStateMode, leaving the writable client lifecycle selected. (src/commands/channels/status.ts:74, 7ed70e7fc400)
  • Latest-release comparison: The v2026.9.5 source also omits read-only state selection for this command; no shipped implementation of this change was established. (src/commands/channels/status.ts, ec9c1a13db89)

Likely related people:

  • Peter Steinberger: 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-20T05:22:13.359Z sha 79e6599 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T09:01:18.341Z sha 035e1a8 :: needs maintainer review before merge. :: none

@steipete steipete changed the title fix(channels): status falls back while shared state is busy fix(channels): keep status reads available during state maintenance Sep 20, 2026
@steipete
steipete merged commit f36e5d3 into main Sep 20, 2026
114 checks passed
@steipete
steipete deleted the codex/channels-status-readonly-01a0a39d branch September 20, 2026 12:40
@steipete

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

cli CLI command changes commands Command implementations docs Improvements or additions to documentation 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: 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