Repository navigation
fix: restore authorized Context breakdown reads - #188670
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.usageto 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
canCallGatewayMethodoption 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 nosessions.usagerequest 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.admingrant 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, close and reopen Context on the exact candidate
context.webm
Visual verification
e02c1f3a7f73657e7b6baa41ff037bb18c49fd5c