Skip to content

feat(agents): add built-in DeepResearch subagent#396

Merged
bobleer merged 1 commit intoGCWing:mainfrom
bobleer:feat/builtin-deep-research-agent
Apr 13, 2026
Merged

feat(agents): add built-in DeepResearch subagent#396
bobleer merged 1 commit intoGCWing:mainfrom
bobleer:feat/builtin-deep-research-agent

Conversation

@bobleer
Copy link
Copy Markdown
Collaborator

@bobleer bobleer commented Apr 13, 2026

Summary

  • Adds DeepResearch as a built-in subagent (alongside Explore and FileFinder) using the Longitudinal + Cross-sectional Analysis method to produce comprehensive, sourced research reports
  • Fixes a subagent deadlock bug where tool confirmation would block indefinitely since no user is present to respond
  • Adds a capability profile for DeepResearch in the frontend agents UI

Changes

Core — new built-in agent

  • deep_research_agent.rs: DeepResearchAgent struct with a curated tool set (WebSearch, WebFetch, Read, Grep, Glob, LS, Write, Bash, TerminalControl, TodoWrite). Task is explicitly excluded to prevent recursive subagent calls.
  • deep_research_agent.md: system prompt implementing an incremental research workflow — orient → plan → research-and-write per chapter → synthesis — so context is never lost on long reports. Key constraints:
    • Every factual claim must be sourced, dated, or attributed; unsourced claims must be labeled (unverified) or (inferred)
    • Full report saved to {workspace}/deep-research/{slug}-{date}.md via {ENV_INFO} placeholder (correct workspace path and date, no guessing)
    • Final reply returns only a 5-finding summary with a clickable file:// hyperlink — not the full report body
  • mod.rs / registry.rs: register DeepResearchAgent as a built-in SubAgent

Core — subagent deadlock fix

  • coordinator.rs: set skip_tool_confirmation: true in ExecutionContext for all subagents. Previously false, which caused subagents using permission-requiring tools (e.g. BashTool) to block indefinitely waiting for a confirmation channel that nobody would ever respond to.

Frontend

  • utils.ts: add DeepResearch capability profile (analysis: 5, docs: 5, creative: 4, coding: 3, ops: 2)

Test plan

  • Build passes: cargo build -p bitfun-core
  • Unit tests pass: cargo test -p bitfun-core deep_research
  • DeepResearch appears in the subagent list in the Agents UI as a built-in agent
  • Triggering DeepResearch via Task tool completes without hanging
  • Report is saved to {workspace}/deep-research/ with correct date
  • Final reply contains a clickable file:// link (not a code block)
  • Recursive self-invocation is not possible (Task tool absent from tool list)

Adds DeepResearch as a built-in subagent using the Longitudinal +
Cross-sectional Analysis method for comprehensive research reports.

Key changes:
- Add `DeepResearchAgent` struct with curated tool set (WebSearch,
  WebFetch, Read, Grep, Glob, LS, Write, Bash, TerminalControl,
  TodoWrite) — Task tool explicitly excluded to prevent recursive
  subagent calls
- Add `deep_research_agent.md` system prompt with incremental
  research workflow: orient → plan → research-and-write per chapter →
  synthesis, so context is never lost on long reports
- Register DeepResearch as a built-in SubAgent in AgentRegistry
  alongside Explore and FileFinder
- Fix subagent tool confirmation deadlock: set `skip_tool_confirmation`
  to `true` in ExecutionContext for all subagents, preventing indefinite
  blocking when no user is present to confirm
- Add DeepResearch capability profile in frontend agents utils
  (analysis:5, docs:5, creative:4, coding:3, ops:2)

Prompt design:
- Requires sourced/dated/attributed claims; unsourced claims must be
  labeled (unverified) or (inferred)
- Saves full report to `{workspace}/deep-research/{slug}-{date}.md`
  and returns only a 5-finding summary with a clickable file:// link
- Uses {ENV_INFO} placeholder so the agent knows the actual workspace
  path and current date without guessing
@bobleer bobleer merged commit 7b7ca91 into GCWing:main Apr 13, 2026
4 checks passed
@bobleer bobleer deleted the feat/builtin-deep-research-agent branch April 15, 2026 11:44
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.

1 participant