Skip to content

Commit de60f42

Browse files
fix(sessions): clarify cross-agent visibility guidance (#90489)
* fix(sessions): clarify cross-agent visibility guidance * fix(sessions): clarify optional agent allow policy --------- Co-authored-by: Vincent Koc <[email protected]>
1 parent c6aa355 commit de60f42

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/agents/tools/sessions-access.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ describe("createSessionVisibilityGuard", () => {
278278
allowed: false,
279279
status: "forbidden",
280280
error:
281-
"Session list visibility is restricted. Set tools.sessions.visibility=all to allow cross-agent access.",
281+
"Session list visibility is restricted. Set tools.sessions.visibility=all and tools.agentToAgent.enabled=true to allow cross-agent access; use tools.agentToAgent.allow to restrict permitted agent pairs.",
282282
});
283283
});
284284

@@ -340,7 +340,7 @@ describe("createSessionVisibilityGuard", () => {
340340
allowed: false,
341341
status: "forbidden",
342342
error:
343-
"Session history visibility is restricted. Set tools.sessions.visibility=all to allow cross-agent access.",
343+
"Session history visibility is restricted. Set tools.sessions.visibility=all and tools.agentToAgent.enabled=true to allow cross-agent access; use tools.agentToAgent.allow to restrict permitted agent pairs.",
344344
});
345345
});
346346

src/plugin-sdk/session-visibility.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,18 @@ function a2aDeniedMessage(action: SessionAccessAction): string {
246246
}
247247

248248
function crossVisibilityMessage(action: SessionAccessAction): string {
249+
const suffix =
250+
"Set tools.sessions.visibility=all and tools.agentToAgent.enabled=true to allow cross-agent access; use tools.agentToAgent.allow to restrict permitted agent pairs.";
249251
if (action === "history") {
250-
return "Session history visibility is restricted. Set tools.sessions.visibility=all to allow cross-agent access.";
252+
return `Session history visibility is restricted. ${suffix}`;
251253
}
252254
if (action === "send") {
253-
return "Session send visibility is restricted. Set tools.sessions.visibility=all to allow cross-agent access.";
255+
return `Session send visibility is restricted. ${suffix}`;
254256
}
255257
if (action === "status") {
256-
return "Session status visibility is restricted. Set tools.sessions.visibility=all to allow cross-agent access.";
258+
return `Session status visibility is restricted. ${suffix}`;
257259
}
258-
return "Session list visibility is restricted. Set tools.sessions.visibility=all to allow cross-agent access.";
260+
return `Session list visibility is restricted. ${suffix}`;
259261
}
260262

261263
function selfVisibilityMessage(action: SessionAccessAction): string {

0 commit comments

Comments
 (0)