fix: make Slack platform capability note tool-aware - #62135
fix: make Slack platform capability note tool-aware#62135tgasgarth-coatue wants to merge 1 commit into
Conversation
Duplicate of #6538 — the earliest open PR making the Slack platform note in |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Looks good! No obvious issues found.
Reviewed by Hermes Agent
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting the real Slack prompt/runtime mismatch.
Problems
- The replacement at
gateway/session.py:499is selected unconditionally.build_session_context_prompt()currently has no loaded-tool argument (gateway/session.py:380-384), and the gateway supplies onlycontextandredact_pii(gateway/run.py:10866). As a result, a Slack session without scoped tools gets the same relaxed note as a session with Slack MCP tools. That misses #6533's required split: retain the conservative note when no scoped tool is available, and emit a capability-aware note only when one is.
Suggested changes
- Thread a stable, session-selected Slack capability signal into the prompt builder, analogous to the existing Discord capability gate at
gateway/session.py:343-365, and cover both tool-present and tool-absent paths intests/gateway/test_session.py.
Automated hermes-sweeper review.
| @@ -497,11 +497,15 @@ def build_session_context_prompt( | |||
| lines.append("") | |||
| lines.append( | |||
| "**Platform notes:** You are running inside Slack. " | |||
There was a problem hiding this comment.
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.
| 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() |
There was a problem hiding this comment.
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.
What changed
Why
Profiles can provide bounded read-only Slack helpers even when Hermes has no native Slack tool. The previous absolute note caused an agent to incorrectly refuse a channel-history summary despite a working helper.
Verification
build_session_context_promptruntime assertion passedpy_compilepassed for changed Python filesgit diff --checkpassed