Skip to content

fix(sessions): let a2a policy gate cross-agent sends independently of visibility#1665

Open
BingqingLyu wants to merge 2 commits into
mainfrom
fork-pr-57483-fix-sessions-send-a2a-visibility
Open

fix(sessions): let a2a policy gate cross-agent sends independently of visibility#1665
BingqingLyu wants to merge 2 commits into
mainfrom
fork-pr-57483-fix-sessions-send-a2a-visibility

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes openclaw#57447

  • createSessionVisibilityGuard() blocked all cross-agent access when visibility !== "all", including sessions_send, even when agentToAgent policy explicitly allowed it
  • This forced an all-or-nothing choice: visibility=all exposes all sessions, visibility=tree blocks legitimate cross-agent messaging
  • One-line fix: skip the visibility gate for "send" action on cross-agent targets, letting a2a policy be the sole authorization gate

Rationale

Action Gate Rationale
list visibility controls what you can see
history visibility controls what you can read
status visibility controls what you can inspect
send a2a policy controls what you can message — sending does not require seeing

Changes

  • src/agents/tools/sessions-access.ts: Add params.action !== "send" to the cross-agent visibility check
  • src/agents/tools/sessions-access.test.ts: Add 2 tests — send allowed with tree+a2a, history still blocked with tree+a2a

Test plan

  • 14 unit tests pass (sessions-access.test.ts)
  • Manual: configure visibility=tree + agentToAgent.enabled=true, verify cross-agent sessions_send works while sessions_history remains blocked

🤖 Generated with Claude Code

anthhub and others added 2 commits March 31, 2026 14:22
… visibility (openclaw#57447)

The visibility guard blocked all cross-agent access when visibility != "all",
including sessions_send, even when agentToAgent policy explicitly allowed it.
This forced users into an all-or-nothing choice between data isolation and
cross-agent messaging.

Now the "send" action bypasses the visibility check for cross-agent targets
and is gated solely by the a2a policy. Read operations (list, history,
status) still respect the visibility setting.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The "send" action now bypasses the visibility gate entirely, so the
"send" case in crossVisibilityMessage is unreachable dead code.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sessions_send blocked by visibility guard even when a2a policy allows cross-agent messaging

1 participant