feat: add fetch_copilot_bridge_documentation tool for agent self-knowledge#122
Merged
feat: add fetch_copilot_bridge_documentation tool for agent self-knowledge#122
Conversation
…ledge Register a new custom tool that provides topic-based documentation about copilot-bridge capabilities to all agents. 12 topics covering overview, commands, config, MCP, permissions, workspaces, hooks, skills, inter-agent communication, scheduling, troubleshooting, and live system status. Key design decisions: - Inbuilt content (not RAG) for reliability and offline use - Topic-based queries to avoid dumping full docs into context - Role-aware: admin agents get config edit instructions, non-admin agents get guidance to defer to admin - Each topic includes source code pointers for deeper investigation - Auto-approved (no permission prompt needed) Includes 22 tests covering all topics, role-aware differences, invalid input handling, and source pointer presence. AGENTS.md templates updated to reference the tool. Fixes #121 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Config topic: use 'platforms' (object) not 'platform', 'channels' as array not object map, remove non-existent defaults fields - Hooks topic: fix discovery paths to match hooks-loader.ts, use 'type: "command"' not 'type: "bash"', version as number not string Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new custom tool (fetch_copilot_bridge_documentation) so agents can query copilot-bridge documentation (features/commands/config/etc.) and a live status view without needing source access, and wires it into session tool registration and agent templates.
Changes:
- Introduces
src/core/bridge-docs.tsimplementing topic-based markdown documentation +getBridgeDocs()API. - Registers the new tool in
SessionManager.buildCustomTools()and auto-approves it viaBRIDGE_CUSTOM_TOOLS. - Adds tests and updates agent/admin AGENTS.md templates to reference the new tool.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/agents/AGENTS.md | Documents the new tool for non-admin agents and when to defer config changes. |
| templates/admin/AGENTS.md | Documents the new tool for admin agents, including source-pointer note. |
| src/core/session-manager.ts | Registers the tool and adds it to the auto-approved custom tools list. |
| src/core/bridge-docs.ts | New documentation module containing all topics plus dynamic status. |
| src/core/bridge-docs.test.ts | New Vitest coverage for all topics, role differences, and invalid input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use fileURLToPath instead of import.meta.dirname for portability - Cache computed version at module scope - Update 'Slack planned' to reflect existing Slack support - Soften 'all slash commands' to 'common slash commands' everywhere - Add /help all pointer for complete command list - Fix BRIDGE_CUSTOM_TOOLS comment to cover read-only tools Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Adds a
fetch_copilot_bridge_documentationcustom tool that lets agents query bridge capabilities, commands, configuration, and system status without needing access to the source code.What it does
Key changes
src/core/bridge-docs.ts: New module with all topic content functions andgetBridgeDocs()exportsrc/core/bridge-docs.test.ts: 22 tests covering all topics, role differences, invalid input, source pointerssrc/core/session-manager.ts: Tool registration inbuildCustomTools(), added toBRIDGE_CUSTOM_TOOLStemplates/admin/AGENTS.md: Bridge Documentation section referencing the tooltemplates/agents/AGENTS.md: Bridge Documentation section with admin deferral noteFixes #121