Skip to content

Add SupportsWebFetch property to agentic engines and automatic web-fetch server integration#1132

Merged
pelikhan merged 8 commits intomainfrom
copilot/fix-a1443e29-ae67-45bd-ac98-026192530ae0
Oct 2, 2025
Merged

Add SupportsWebFetch property to agentic engines and automatic web-fetch server integration#1132
pelikhan merged 8 commits intomainfrom
copilot/fix-a1443e29-ae67-45bd-ac98-026192530ae0

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 1, 2025

Add SupportsWebFetch property to agentic engines

✅ Completed tasks:

  • Add SupportsWebFetch() method to CodingAgentEngine interface in agentic_engine.go
  • Add supportsWebFetch field to BaseEngine struct
  • Implement SupportsWebFetch() method in BaseEngine
  • Set supportsWebFetch to appropriate values for each engine (Claude=true, Codex/Copilot/Custom=false)
  • Create pkg/workflow/fetch.go with shared code to add web-fetch MCP server
  • Update compiler to check SupportsWebFetch() and add MCP fetch server when needed
  • Update all engines (Claude, Codex, Copilot, Custom) to render web-fetch server configuration
  • Write unit tests for the new functionality
  • Write integration tests to verify end-to-end behavior
  • Build and test all changes - all tests pass ✓
  • Manually verify the behavior with test workflows
  • Address code review comments about config usage
  • Change MCP server name from "mcp/fetch" to "web-fetch" per review feedback
  • Use mcp/fetch Docker image from Docker Hub
  • Update dev.md to test web-fetch functionality
  • Add "tools": ["*"] field for Copilot engine MCP configurations
  • Add --allow-tool web-fetch permission for Copilot engine

Implementation details:

  • Claude engine supports web-fetch natively (supportsWebFetch=true) - uses native WebFetch tool
  • Codex, Copilot, and Custom engines don't support web-fetch natively (supportsWebFetch=false)
  • When web-fetch tool is requested and engine doesn't support it, the compiler automatically adds web-fetch MCP server
  • Shared rendering code in fetch.go supports both JSON (Claude, Custom, Copilot) and TOML (Codex) formats
  • The web-fetch MCP server uses mcp/fetch Docker image from Docker Hub
  • Server name is "web-fetch" to match the tool name for consistency
  • Copilot engine MCP servers include "tools": ["*"] field as required by Copilot CLI
  • Copilot engine now adds --allow-tool web-fetch permission when web-fetch MCP server is configured
  • dev.md workflow now includes web-fetch testing

Verification:

  • ✅ Copilot workflow with web-fetch → web-fetch MCP server added with "tools": ["*"] field and --allow-tool web-fetch permission
  • ✅ Codex workflow with web-fetch → web-fetch MCP server added (TOML format, no tools field)
  • ✅ Claude workflow with web-fetch → WebFetch native tool used (no MCP server)
  • ✅ All unit tests pass (11 test cases including new tools field tests)
  • ✅ All integration tests pass (3 scenarios tested)
  • ✅ Code formatted correctly with make fmt
  • ✅ All code review comments addressed
Original prompt

Add a property to the agentic engine, supportsWrbFetch that determines of the engine has builtin support for the web-fetch tool.

If not supported add the "mcp/fetch" dockerized mcp server to the mcp server configuration. (This code should be shared, place in fetch.go)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 1, 2025 18:47
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add a property to the agentic engine, supportsWrbFetch that determines of the engine has builtin support for the web-fetch tool. If not supported add the "mcp/fetch" dockerized mcp server to the mcp server configuration. (This code should be shared, ... Add SupportsWebFetch property to agentic engines and automatic mcp/fetch server integration Oct 1, 2025
Copilot AI requested a review from pelikhan October 1, 2025 18:58
Comment thread pkg/workflow/claude_engine.go Outdated
Comment thread pkg/workflow/codex_engine.go Outdated
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add SupportsWebFetch property to agentic engines and automatic mcp/fetch server integration Add SupportsWebFetch property to agentic engines and automatic web-fetch server integration Oct 1, 2025
Copilot AI requested a review from pelikhan October 1, 2025 19:21
@pelikhan pelikhan marked this pull request as ready for review October 1, 2025 19:23
Comment thread pkg/workflow/fetch.go Outdated
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan October 1, 2025 20:14
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 1, 2025

@copilot the copilot agentic engine requires ' "tools": ["*"],' in the mcp server configurations.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 1, 2025

@copilot the copilot agentic engine requires ' "tools": ["*"],' in the mcp server configurations.

Added "tools": ["*"] field to Copilot web-fetch MCP server configuration in commit 4343f1d.

Copilot output:

"web-fetch": {
  "command": "docker",
  "args": ["run", "-i", "--rm", "mcp/fetch"],
  "tools": ["*"]
}

Other engines (Claude, Codex, Custom) don't include this field as they don't require it.

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 2, 2025

@copilot update the tool allow list for web-fetch to use any tools in the copilot engine.

--allow-tool web-fetch

See error in https://github.com/githubnext/gh-aw/actions/runs/18182698880/job/51761513740

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 2, 2025

@copilot update the tool allow list for web-fetch to use any tools in the copilot engine.

--allow-tool web-fetch...

Added --allow-tool web-fetch permission for Copilot engine in commit 549f961.

Change: Removed web-fetch from builtInTools list so it's processed as an MCP server and gets the allow-tool permission.

Copilot command output:

copilot ... --allow-tool safe_outputs --allow-tool web-fetch --prompt "$INSTRUCTION"

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/githubnext/gh-aw/actions/runs/18182698880/jobs
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan merged commit e40bcaf into main Oct 2, 2025
19 of 22 checks passed
@pelikhan pelikhan deleted the copilot/fix-a1443e29-ae67-45bd-ac98-026192530ae0 branch October 2, 2025 04:10
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.

2 participants