xonecas.io
62159
Sy

symb / commit 1005b7d

fix: web tools fixes that were missed when adopting exa

xonecas2026-02-19 1005b7dbae7b2c742035a02d6dcd671e5540f217 parent 4b7c34e

5 files changed

cmd/symb/main.go+1−0
@@ -107,6 +107,7 @@ func main() {
107107 svc.deltaTracker,
108108 svc.shell,
109109 tools,
110+ svc.proxy.Upstream(),
110111 )
111112 svc.proxy.RegisterTool(mcptools.NewSubAgentTool(), subAgentHandler.Handle)
112113
internal/llm/prompts/base.md+2−1
@@ -7,6 +7,7 @@ You are **Symb**, an AI coding assistant that helps users write, understand, and
77 - Short responses, no preambles or postambles
88 - Use Markdown formatting for your replies
99 - Prioritize technical accuracy and evidence over assumptions
10+- Use the tooling provided over their shell counterparts when applicable
1011
1112 ## Approach
1213
@@ -30,7 +31,7 @@ Fix problems at the root cause. Do not fix unrelated bugs or broken tests — me
3031 - **Delegate exploration:** Spawn a SubAgent to explore code or research — reserve your own Read/Grep for files you're about to edit
3132 - **Read budget:** Limit yourself to 3–5 consecutive read-only calls before editing, summarizing in TodoWrite, or spawning a SubAgent
3233 - **No re-reads:** Do not re-read files already in context
33-- **Web research:** Always delegate to a SubAgent; never chain more than 2 WebSearch/WebFetch calls yourself
34+- **Web research:** Use the Exa tools `*_exa` to read and search the web. Use a web subagents for large searches
3435 - **Parallelism:** Spawn independent SubAgents concurrently; never put two SubAgents on the same file
3536
3637 ## Code Workflow
internal/llm/prompts/subagent_web.md+1−1
@@ -3,7 +3,7 @@
33 You are a web researcher. Find documentation, API references, and library info.
44
55 Rules:
6-- Use only WebSearch and WebFetch
6+- Always use the `*_exa` tools to read and search the web before assuming
77 - Summarize findings concisely — the parent agent needs actionable info, not raw pages
88 - Include source URLs for reference
99 - If information is ambiguous or conflicting, note that explicitly
internal/mcp/proxy.go+7−0
@@ -241,6 +241,13 @@ func (p *Proxy) HasUpstream() bool {
241241 return p.upstream != nil
242242 }
243243
244+// Upstream returns the upstream client, or nil if none is configured.
245+func (p *Proxy) Upstream() UpstreamClient {
246+ p.mu.RLock()
247+ defer p.mu.RUnlock()
248+ return p.upstream
249+}
250+
244251 // LocalToolCount returns the number of registered local tools.
245252 func (p *Proxy) LocalToolCount() int {
246253 p.mu.RLock()
internal/mcptools/subagent.go+6−2
@@ -45,6 +45,7 @@ type SubAgentHandler struct {
4545 deltaTracker *delta.Tracker
4646 sh *shell.Shell
4747 allTools []mcp.Tool
48+ upstream mcp.UpstreamClient
4849 }
4950
5051 // NewSubAgentHandler creates a handler for the SubAgent tool.
@@ -54,6 +55,7 @@ func NewSubAgentHandler(
5455 deltaTracker *delta.Tracker,
5556 sh *shell.Shell,
5657 allTools []mcp.Tool,
58+ upstream mcp.UpstreamClient,
5759 ) *SubAgentHandler {
5860 // Validate required dependencies
5961 if prov == nil {
@@ -69,6 +71,7 @@ func NewSubAgentHandler(
6971 deltaTracker: deltaTracker,
7072 sh: sh,
7173 allTools: allTools,
74+ upstream: upstream,
7275 }
7376 }
7477
@@ -94,8 +97,9 @@ func (h *SubAgentHandler) Handle(ctx context.Context, arguments json.RawMessage)
9497 subEditHandler := NewEditHandler(subTracker, h.lspManager, h.deltaTracker)
9598 subShellHandler := NewShellHandler(h.sh)
9699
97- // Create proxy with sub-agent tools (filtered - no nested SubAgent)
98- subProxy := mcp.NewProxy(nil)
100+ // Create proxy with sub-agent tools (filtered - no nested SubAgent).
101+ // Pass upstream so tools like web_search_exa can be dispatched.
102+ subProxy := mcp.NewProxy(h.upstream)
99103 filteredTools := subagent.FilterToolsForType(h.allTools, args.Type)
100104
101105 // Register tools with sub-agent proxy