Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions gateway/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,15 @@ def build_session_context_prompt(
lines.append("")
lines.append(
"**Platform notes:** You are running inside Slack. "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note is emitted for every Slack session, regardless of whether a scoped Slack tool is actually exposed. Please select it from an explicit, stable loaded-tool capability signal so no-tool sessions retain the conservative disclaimer required by #6533.

"You do NOT have access to Slack-specific APIs — you cannot search "
"channel history, pin/unpin messages, manage channels, or list users. "
"Do not promise to perform these actions. The gateway may inline the "
"current message's Slack block/attachment payload when available, but "
"you still cannot call Slack APIs yourself."
"Slack does not automatically expose a native Slack API tool. Do not "
"claim that channel history, member lookup, pinning, or admin actions "
"are available unless a loaded tool, plugin, or profile-provided bounded "
"helper supports them. For read-only requests such as channel history, "
"thread context, or member lookup, inspect the available tools and skills "
"first and use a bounded helper when present; do not infer lack of access "
"from this generic note. Never promise write or admin actions without an "
"explicit supporting tool. The gateway may also inline the current "
"message's Slack block/attachment payload when available."
)
elif context.source.platform == Platform.DISCORD:
# Inject the Discord IDs block only when the agent actually has
Expand Down
7 changes: 5 additions & 2 deletions tests/gateway/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,11 @@ def test_slack_prompt_includes_platform_notes(self):
prompt = build_session_context_prompt(ctx)

assert "Slack" in prompt
assert "cannot search" in prompt.lower()
assert "pin" in prompt.lower()
assert "does not automatically expose a native slack api tool" in prompt.lower()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test covers only the single generic note. Add separate tool-present and tool-absent cases so the regression contract verifies that no-tool sessions remain conservative while scoped Slack-tool sessions are acknowledged.

assert "inspect the available tools and skills first" in prompt.lower()
assert "bounded helper when present" in prompt.lower()
assert "do not infer lack of access" in prompt.lower()
assert "write or admin actions" in prompt.lower()
assert "current message's slack block/attachment payload" in prompt.lower()

def test_discord_prompt_with_channel_topic(self):
Expand Down