feat(prompt): Platform Capabilities preamble at top of system prompt (#2332 item 1) - #2340
Merged
HongmingWang-Rabbit merged 1 commit intoApr 30, 2026
Merged
Conversation
Closes #2332 item 1 (workspace awareness — agents don't surface platform-native tools up front). The dogfooding session surfaced that agents weren't using A2A delegation, persistent memory, or send_message_to_user. The tools were registered AND documented in the system prompt — but only in sections #8 (Inter-Agent Communication) and #9 (Hierarchical Memory), which agents read AFTER they've already started reasoning about a plan from earlier sections. This adds a tight inventory at section #1.5 (immediately after Platform Instructions, before role-specific prompt files) — every tool name + its short description in a bulleted block. Detailed when_to_use docs in sections #8/#9 stay; this preamble is the elevator pitch ("you have these"), the later sections are the manual ("here's when and how"). Generated from `platform_tools.registry` ToolSpecs — every tool's `name` + `short` flow through automatically, no manual sync. A new `get_capabilities_preamble(mcp: bool)` helper in executor_helpers mirrors the existing get_a2a_instructions / get_hma_instructions pattern. CLI-runtime agents (mcp=False) get an empty preamble — they see _A2A_INSTRUCTIONS_CLI's hand-written subcommand vocabulary further down, and the registry's MCP tool names would conflict. Tests: - test_capabilities_preamble_appears_in_mcp_prompt: header present - test_capabilities_preamble_lists_every_registry_tool: every a2a + memory tool from registry shows up (drift catches at test time — adding a new tool to registry surfaces here automatically) - test_capabilities_preamble_precedes_prompt_files: ordering invariant (toolkit before role docs) - test_capabilities_preamble_skipped_for_cli_runtime: empty when mcp=False All 40 prompt + platform_tools tests pass.
HongmingWang-Rabbit
requested a review
from hongmingwang-moleculeai
as a code owner
April 30, 2026 04:31
HongmingWang-Rabbit
enabled auto-merge
April 30, 2026 04:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2332 item 1.
Why
Dogfooding session finding: agents don't use `delegate_task`, `commit_memory`, `send_message_to_user`, etc. The tools ARE in the system prompt — but only in sections 8 (Inter-Agent Communication) and 9 (Hierarchical Memory). By the time agents read those, they've already committed to a plan based on earlier sections.
What
Tight inventory at section 1.5 (immediately after Platform Instructions, before role-specific prompt files) — every tool's `name` + `short` description in one bulleted block. Detailed `when_to_use` docs in sections 8/9 stay; this is the elevator pitch.
```
Platform Capabilities
You have native access to these platform tools. Use them proactively...
Inter-agent collaboration (A2A):
Persistent memory (HMA):
```
How
Tests
4 new cases in `test_prompt.py` (40/40 prompt + platform_tools tests pass):
What this does NOT change
Closes
#2332 item 1 — leave issue open for items 2 + 3.
🤖 Generated with Claude Code