Conversation
- Introduced `promptOverrides` configuration in the `Config` interface to allow users to customize built-in prompt templates. - Implemented parsing of prompt overrides in the SSE API routes, ensuring validation and error handling. - Updated various components and hooks to utilize the new prompt overrides, including `KnowledgeGraph`, `FinalReport`, and `useDeepResearch`. - Enhanced prompt generation functions to support dynamic templates based on user-defined overrides. - Added UI elements in the settings to allow users to input JSON for prompt overrides, with appropriate validation and error messages. - Updated localization files to include new strings related to prompt overrides.
…mproved topic management
…ve resource handling
…rs and report preferences
…ionality across various components
…import functionality and shortcut management
There was a problem hiding this comment.
Pull request overview
This PR expands the Deep Research app’s configurability and UX by introducing prompt template overrides, new research workflow controls, domain-filtered web search, and multiple UI enhancements (workflow progress, keyboard shortcuts, session import/export, and richer task management).
Changes:
- Add a prompt-template override system (
DeepResearchPromptOverrides) and plumb it through deep-research prompts, search providers, UI, and SSE APIs. - Add new research controls and UX: workflow progress widget, submit shortcuts (Ctrl/Cmd+Enter), task filtering/sorting/export, and session snapshot import/export + global keyboard shortcuts.
- Add web search domain include/exclude filters and new settings for report style/length, auto follow-up rounds, and collection topic limits.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/deep-research/search.ts | Accepts prompt overrides and uses resolved templates in provider prompts (e.g., Exa rewriting). |
| src/utils/deep-research/prompts.ts | Refactors deep-research prompt builders to accept prompt overrides and adds output-guidelines accessor. |
| src/utils/deep-research/index.ts | Parses and persists prompt overrides at runtime; passes overrides through deep research pipeline. |
| src/store/setting.ts | Adds new persisted settings (auto review rounds, domain filters, report style/length, prompt overrides). |
| src/locales/zh-CN.json | Adds translations for new header/session features, workflow UI, settings, and task management strings. |
| src/locales/vi-VN.json | Adds translations for new header/session features, workflow UI, settings, and task management strings. |
| src/locales/es-ES.json | Adds translations for new header/session features, workflow UI, settings, and task management strings. |
| src/locales/en-US.json | Adds translations for new header/session features, workflow UI, settings, and task management strings. |
| src/hooks/useWebSearch.ts | Adds domain include/exclude filtering to third-party web search results. |
| src/hooks/useSubmitShortcut.ts | Introduces reusable Ctrl/Cmd+Enter “submit” shortcut hook for inputs/textareas. |
| src/hooks/useKnowledge.ts | Makes rewriting prompt respect deep research prompt overrides from settings. |
| src/hooks/useDeepResearch.ts | Adds prompt overrides support; introduces auto review rounds, topic caps, and report preference requirements. |
| src/constants/prompts.ts | Defines canonical deep-research prompt templates, override parsing, and template resolution logic. |
| src/components/Setting.tsx | Adds UI + validation for new settings (prompt overrides JSON, domain filters, report style/length, review/topic sliders). |
| src/components/Research/WorkflowProgress.tsx | Adds a workflow progress component showing stage completion and overall progress. |
| src/components/Research/Topic.tsx | Adds quick-start topic presets and Ctrl/Cmd+Enter submission; improves label semantics. |
| src/components/Research/SearchResult.tsx | Adds task search/filter/sort, expand/collapse all, retry/remove failed tasks, and filtered export (MD/JSON). |
| src/components/Research/FinalReport/index.tsx | Adds Ctrl/Cmd+Enter submission and applies prompt overrides to Artifact system instruction. |
| src/components/Research/FinalReport/KnowledgeGraph.tsx | Makes knowledge graph prompt respect prompt overrides. |
| src/components/Research/Feedback.tsx | Adds Ctrl/Cmd+Enter submission shortcut hint/behavior. |
| src/components/Internal/Header.tsx | Adds session snapshot export/import, shortcuts dialog, and global keyboard shortcuts. |
| src/app/page.tsx | Inserts workflow progress component into the main page flow. |
| src/app/layout.tsx | Adds suppressHydrationWarning to body to reduce hydration warnings. |
| src/app/api/sse/route.ts | Adds prompt override parsing/validation for POST SSE endpoint and passes into DeepResearch. |
| src/app/api/sse/live/route.ts | Adds prompt override parsing/validation for GET SSE endpoint and passes into DeepResearch. |
| docs/deep-research-api-doc.md | Documents promptOverrides support in the public SSE API config. |
| AGENTS.md | Adds contributor/agent guidance (commands, conventions, project structure, testing note). |
| .vscode/settings.json | Updates editor settings (files.exclude additions and related workspace config). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const enableCitationImage = | ||
| getValueFromSearchParams("enableCitationImage") === "false"; | ||
| const enableReferences = | ||
| getValueFromSearchParams("enableReferences") === "false"; | ||
| const enableFileFormatResource = |
There was a problem hiding this comment.
In the live SSE route, enableCitationImage/enableReferences are derived with === "false", which inverts the meaning ("false" becomes true) and also makes the default false when the query param is omitted. These flags should default to true and only be false when the param explicitly indicates false (e.g., parse boolean or use !== "false").
| const options: SearchProviderOptions = { | ||
| provider: searchProvider, | ||
| maxResult: searchMaxResult, | ||
| query, | ||
| }; |
There was a problem hiding this comment.
SearchProviderOptions now supports promptOverrides, but useWebSearch never passes prompt overrides from settings into createSearchProvider. As a result, overrides like rewritingPrompt won't affect providers (e.g., Exa summary rewriting) when web search runs from the UI. Consider parsing deepResearchPromptOverrides from useSettingStore and setting options.promptOverrides before calling createSearchProvider.
| // Override built-in prompt templates. You can provide one or more prompt keys as needed. (optional) | ||
| promptOverrides?: Partial<{ | ||
| systemInstruction: string; | ||
| outputGuidelinesPrompt: string; | ||
| systemQuestionPrompt: string; |
There was a problem hiding this comment.
The documentation lists a fixed set of promptOverrides keys, but the implementation supports additional keys (e.g., guidelinesPrompt, serpQuerySchemaPrompt, rewritingPrompt, knowledgeGraphPrompt, etc.). To avoid drifting docs, consider referencing the canonical key list (or listing all supported keys) so API consumers know what can be overridden.
|
Thank you for your contribution to this project. The feature you submitted is very useful and fills a gap in our functionality in this area. I have merged your code into the main branch and upgraded the project version to v0.11.0.
These two changes are primarily due to the limited screen space on mobile devices; I believe it's important to allow users to focus their attention on the core functionality. |
No description provided.