Skip to content

fix: restore authorized Context breakdown reads - #188670

Merged
shakkernerd merged 1 commit into
mainfrom
context-report-read-admission
Oct 30, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
context-report-read-admission

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #188662.

What Problem This Solves

An operator with permission to read usage can see a permission error when opening an ordinary chat’s Context breakdown, even when the chat has a saved matching report. The Context read guard requires sessions.usage to appear in the hello’s advertised methods, but the server deliberately leaves this registered method out of that list.

User Impact

Authorized operators can load the existing saved Context breakdown from the composer popover and Context panel. The existing scope checks still prevent restricted operators from sending usage reads, and revoking access still clears retained results and retires pending responses. No server advertisement, role, protocol, configuration, or session-target selection changes are included.

Why This Change Was Made

The report owner now uses the existing canCallGatewayMethod option for methods that are supported but intentionally unadvertised. This preserves the helper’s connected-client and canonical scope checks and keeps the existing cache, retry, session-ID, model, and provider guards in the report owner.

The existing owner tests now use an unadvertised usage method, matching the real hello. Their assertions and lifecycle scenarios remain unchanged; no additional test cases or alternative permission logic are needed.

Evidence

A real ordinary chat with a successful agent turn reproduced the problem: its connection granted operator.admin, the popover showed the permission error with zero category rows, and no sessions.usage request was sent. An authorized native read returned that chat’s matching saved report. The production-owner regression also failed on the base when the artificial usage advertisement was removed.

Remote changed-file formatting/lint and affected type graphs passed on the exact candidate tree. All 58 tests across four owner, caller, and method-admission files passed, including restricted reads, revocation during a pending read, reconnect retirement, report identity mismatches, retry/cache lifecycle, and the Context panel’s empty states. The two targeted test stages took 3.45 and 5.63 seconds. Test line count is unchanged.

The same live ordinary chat now displays five categories after one authorized read under the unchanged operator.admin grant and still-unadvertised method. The returned report matches the original session ID and its counters; the overall usage remains 23.1k / 252k. The focused keyboard recording also confirms that closing and reopening the popover reuses the saved report without another read.

Independent engineering review is clean. Canonical AutoReview also returned scoped-clean at P0–P2 for base 48df899 through head e02c1f3. All selected hosted CI jobs passed. The hosted ClawSweeper run ended without a usable verdict after its review lease was superseded; no rating is claimed. Live proof covers one administrator and ordinary chat on macOS/Chromium; narrower read grants and access retirement are covered by the production-owner tests.

Visual evidence

Open preview

Before After
Authorized operator sees a permission error and no Context categories The same chat displays five Context categories after one authorized read

Open, close and reopen Context on the exact candidate

context.webm

Visual verification

  • Baseline: 7d9677c
  • Exact head: e02c1f3a7f73657e7b6baa41ff037bb18c49fd5c
  • Scenario: Open an ordinary chat's Context ring as an authorized operator while sessions.usage remains unadvertised; close and reopen the saved report.
  • Runtime/build: OpenClaw 2026.10.9-e02c1f3a7f73-2026-10-30T20-11-43.112Z; source owner blob e7e9bf6f80fde3b59352bdede57684ecb6a7cb1c
  • Granted scope and advertisement: operator.admin; sessions.usage unadvertised before and after
  • Before → after: 0 → 1 usage requests; 0 → 5 categories; permission denial removed
  • Report identity: Saved report matches the unchanged ordinary chat session ID
  • Cached reopen: Five categories remain available with one total usage request
  • Context total: 23.1k / 252k · 9% before and after
  • Actual baseline and exact candidate native source/build bindings retained
  • Equivalent viewport, theme, ordinary chat, scope and saved report; natural popover height changes with restored categories
  • Both screenshots inspected; complete recording inspected through all 241 frame images
  • Video masks other UI before first paint without changing Context layout or behavior; keyboard cue identifies the real input
  • No prompt, history, tool-schema content, account labels, private URLs or credentials exported
  • Restricted read, pending access retirement, reconnect, identity and retry controls passed in existing owner tests
  • Equal 300×274 media canvas: the original 300×232 baseline crop has 42 pixels of blank bottom padding; product pixels are unchanged.

@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 in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@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. labels Oct 30, 2026
@shakkernerd
shakkernerd merged commit 093d71e into main Oct 30, 2026
106 checks passed
@shakkernerd
shakkernerd deleted the context-report-read-admission branch October 30, 2026 20:36
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: authorized operators can open the saved Context breakdown when the usage method is intentionally unadvertised.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
Restore saved Context breakdowns for operators who already have usage-read access when the supported usage method is intentionally unadvertised.

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

Labels

app: web-ui App: web-ui 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. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context breakdown denies an authorized operator when usage is unadvertised

1 participant