fix(usage): return all agent sessions when no agentId specified#87335
fix(usage): return all agent sessions when no agentId specified#87335Jefsky wants to merge 3 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: the linked usage bug is already solved on current main by the merged explicit-scope implementation in #87222, while this branch changes the omitted-agent default in a way that conflicts with the gateway scoping contract. Canonical path: Keep current main's explicit So I’m closing this here and keeping the remaining discussion on #87222. Review detailsBest possible solution: Keep current main's explicit Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: this branch sets Is this the best way to solve the issue? No. The maintainable fix is the merged explicit-scope path: the UI asks for all agents intentionally, while existing gateway callers that omit Security review: Security review needs attention: The diff broadens a session-usage boundary by making omitted
AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 98611e62728e; fix evidence: commit 99bd27535985, main fix timestamp 2026-05-29T02:03:33+01:00. |
|
ClawSweeper PR egg: 🎁 locked until real behavior proof passes. Details
|
Behavior Proof:
|
Fixes openclaw#87132. When no agentId is specified in the sessions.usage request, the backend previously defaulted to returning only the default agent's sessions. This caused the Web UI's agent filter to only show main agent sessions. - When agentId is omitted and no specific session key is provided, effectiveAgentId is now undefined instead of defaulting to the configured default agent - When effectiveAgentId is undefined, skip the filterSessionStoreByAgent step so all agents' sessions are returned - Updated test to verify that sessions from all configured agents are returned when no agentId is specified
87f63e5 to
6e6c48e
Compare
The test mocked discoverAllSessions with mockResolvedValueOnce for main agent only. With the all-agent discovery change, opus agent sessions are also returned. Updated test to mock both agent calls and assert all 4 sessions are returned.
This comment was marked as spam.
This comment was marked as spam.
|
Superseded by #87823 — preserves the shipped gateway scoping contract by adding |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Fixes #87132.
When no is specified in the request, the backend previously defaulted to returning only the default agent's sessions (usually "main"). This caused the Web UI's agent filter to only show main agent sessions, making it impossible to filter by other agents.
Changes
Test Plan
Issue: #87132