feat(deep-research): add Pro mode 6-phase pipeline and ResearchSpecia…#613
Merged
Conversation
…list subagent
Adds an opt-in Pro mode to the deep-research agent triggered by user messages
beginning with `深度研究:` or `deep:`. Pro mode runs a 6-phase quality
protocol: query understanding → 4 parallel specialists → citation registry →
adversarial debate (2 rounds) → fact check → manager arbitration → report.
The existing longitudinal/cross-sectional flow stays as the default mode.
Introduces ResearchSpecialist, a new readonly built-in subagent with
WebSearch/WebFetch/Read tools. The previous research flow dispatched to the
Explore subagent, which only carries code-search tools and silently produced
empty findings for web research. ResearchSpecialist returns markdown via the
Task result and the parent agent owns all file writes — required because the
Task tool only treats readonly subagents as concurrency-safe.
Adds bilingual research policy: the parent detects USER_LANG and drives all
prose in USER_LANG, while specialists issue queries in both USER_LANG and
English so source ecosystems on both sides are covered. Quotes stay verbatim
in their source language.
Adds {SESSION_ID} placeholder substitution in prompt_builder so Pro mode can
anchor a per-session WORK_DIR under .bitfun/sessions/{SESSION_ID}/research.
Adds AskUserQuestion to the deep-research agent's default tools for Phase 0
clarification and Phase 5 GAP confirmation.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.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.
…list subagent
Adds an opt-in Pro mode to the deep-research agent triggered by user messages beginning with
深度研究:ordeep:. Pro mode runs a 6-phase quality protocol: query understanding → 4 parallel specialists → citation registry → adversarial debate (2 rounds) → fact check → manager arbitration → report. The existing longitudinal/cross-sectional flow stays as the default mode.Introduces ResearchSpecialist, a new readonly built-in subagent with WebSearch/WebFetch/Read tools. The previous research flow dispatched to the Explore subagent, which only carries code-search tools and silently produced empty findings for web research. ResearchSpecialist returns markdown via the Task result and the parent agent owns all file writes — required because the Task tool only treats readonly subagents as concurrency-safe.
Adds bilingual research policy: the parent detects USER_LANG and drives all prose in USER_LANG, while specialists issue queries in both USER_LANG and English so source ecosystems on both sides are covered. Quotes stay verbatim in their source language.
Adds {SESSION_ID} placeholder substitution in prompt_builder so Pro mode can anchor a per-session WORK_DIR under .bitfun/sessions/{SESSION_ID}/research. Adds AskUserQuestion to the deep-research agent's default tools for Phase 0 clarification and Phase 5 GAP confirmation.