close
Skip to content

feat: add fetch_copilot_bridge_documentation tool for agent self-knowledge#122

Merged
ChrisRomp merged 3 commits intomainfrom
feat/bridge-docs-tool
Mar 20, 2026
Merged

feat: add fetch_copilot_bridge_documentation tool for agent self-knowledge#122
ChrisRomp merged 3 commits intomainfrom
feat/bridge-docs-tool

Conversation

@ChrisRomp
Copy link
Copy Markdown
Owner

Summary

Adds a fetch_copilot_bridge_documentation custom tool that lets agents query bridge capabilities, commands, configuration, and system status without needing access to the source code.

What it does

  • 12 topic-based documentation queries: overview, commands, config, MCP, permissions, workspaces, hooks, skills, inter-agent, scheduling, troubleshooting, live status
  • Role-aware responses: 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)

Key changes

  • src/core/bridge-docs.ts: New module with all topic content functions and getBridgeDocs() export
  • src/core/bridge-docs.test.ts: 22 tests covering all topics, role differences, invalid input, source pointers
  • src/core/session-manager.ts: Tool registration in buildCustomTools(), added to BRIDGE_CUSTOM_TOOLS
  • templates/admin/AGENTS.md: Bridge Documentation section referencing the tool
  • templates/agents/AGENTS.md: Bridge Documentation section with admin deferral note

Fixes #121

ChrisRomp and others added 2 commits March 20, 2026 09:48
…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>
Copilot AI review requested due to automatic review settings March 20, 2026 17:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.ts implementing topic-based markdown documentation + getBridgeDocs() API.
  • Registers the new tool in SessionManager.buildCustomTools() and auto-approves it via BRIDGE_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.

Comment thread src/core/bridge-docs.ts Outdated
Comment thread src/core/bridge-docs.ts
Comment thread src/core/session-manager.ts Outdated
Comment thread templates/agents/AGENTS.md Outdated
Comment thread templates/admin/AGENTS.md Outdated
Comment thread src/core/session-manager.ts Outdated
Comment thread src/core/bridge-docs.ts
- 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>
@ChrisRomp ChrisRomp merged commit 240390c into main Mar 20, 2026
6 checks passed
@ChrisRomp ChrisRomp deleted the feat/bridge-docs-tool branch March 20, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add fetch_copilot_bridge_documentation tool for agent self-knowledge

2 participants