#11175: fix: add sessions.usage methods to READ_METHODS for authorization
gateway
Cluster:
OpenClaw Plugin Enhancements
## Summary
- `sessions.usage`, `sessions.usage.timeseries`, and `sessions.usage.logs` handlers are registered in `usageHandlers` but missing from the `READ_METHODS` set in `authorizeGatewayMethod`
- Non-admin operator clients calling these methods are rejected because the authorization falls through to the default admin-scope requirement
- Add the three methods to `READ_METHODS` so they are accessible with `operator.read` scope, consistent with other read-only usage methods (`usage.status`, `usage.cost`)
## Test plan
- [x] All 37 gateway server-methods tests pass
- [x] Verified the three methods are read-only operations (query cost/usage data)
- [x] Consistent with existing `usage.status` and `usage.cost` in `READ_METHODS`
Closes #11121
Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates gateway method authorization by adding `sessions.usage`, `sessions.usage.timeseries`, and `sessions.usage.logs` to the `READ_METHODS` allowlist in `src/gateway/server-methods.ts`. This aligns these session-usage query endpoints with existing read-only usage endpoints (e.g. `usage.status`, `usage.cost`) so operator clients with `operator.read` (or `operator.write`) scopes can call them, instead of falling through to the default `operator.admin` requirement.
No functional issues were found in the change itself; it is a narrow authorization fix limited to the read-method set used by `authorizeGatewayMethod`.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a small, targeted adjustment to the READ_METHODS allowlist used for scope-based authorization, and it matches the documented intent (treating session usage queries as read-only). No new control flow or handler behavior is introduced.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#11864: fix: add missing methods to BASE_METHODS for client discovery
by Yida-Dev · 2026-02-08
79.6%
#12802: fix(gateway): default unscoped operator connections to read-only
by yubrew · 2026-02-09
77.8%
#20650: fix(gateway): include deleted/reset sessions in usage.cost RPC (#20...
by lailoo · 2026-02-19
75.9%
#21622: fix(gateway): include read/write in CLI default operator scopes
by zerone0x · 2026-02-20
74.6%
#22666: fix(gateway): operator.admin should imply all operator scopes
by maximveksler · 2026-02-21
74.5%
#13215: fix: pass agentId to loadCostUsageSummary in /usage cost command
by veast · 2026-02-10
74.2%
#17195: fix: Add operator.read/write scopes to Dashboard auto-pairing
by MisterGuy420 · 2026-02-15
73.9%
#22583: fix(gateway): add operator.write to scope hierarchy (#22574)
by lailoo · 2026-02-21
73.8%
#21651: fix(gateway): token fallback + operator.admin scope superset in pai...
by lan17 · 2026-02-20
73.7%
#20603: fix(gateway): scan all agents in usage.cost RPC (#20558)
by lailoo · 2026-02-19
73.5%