Adaptive Research#78
Merged
EdgeTypE merged 18 commits intoJun 19, 2026
Merged
Conversation
…-search-results Narrow auto-search queries and rank DDG/Bing fallback results
… sourceType logic
- Suppress AUTO tags during managed Deep Research runs to prevent disruption of BDS logic. - Implement report synthesis for managed runs when no report tag is present in the latest assistant message. - Introduce step completion handling with new DEEP_RESEARCH_STEP_DONE tag, allowing for detailed step analysis and error handling. - Update DeepResearchStatusCard to reflect managed execution state, including progress and current step details. - Modify payload mutator to clarify Deep Research toggle intent in user prompts. - Enhance tests for parsing and handling of new deep research features, including step completion and reporting.
…cked transitions feat(message-processor): defer Deep Research step-done side effects until generation is complete
…f icon-only buttons and file-backed transitions
…chat inputs and file transitions
…ath checks and add integration tests for send controls
…emission and add corresponding tests
…t fallbacks for over-limit scenarios and improve evidence digest handling
…for dynamic follow-ups
…n and malformed URL checks
Add per-conversation context budget tracking to prevent DeepSeek web-chat context window overflow during managed Deep Research runs. - context-budget.js: token estimation, recording, server calibration - Enforce budget before sending step results; skip remaining steps and request compact final report when threshold would be crossed - Mark skipped steps as skipped_budget; block adaptive steps after stop - Budget-aware final report prompt names completed/skipped steps - Advanced Settings: toggle, limit tokens, stop percent (50-95%) - Clear budget on cancel/complete/disable - 41 new regression tests (context guard + SettingsPanel UI) - All 751 tests pass, CI green
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.
With respect to Deep Research: PR introduces significant improvements to the automatic search, file sending, and chat input handling logic in
src/content/auto.js, as well as enhancements to context budget tracking insrc/content/bridge.js. The changes focus on making search deduplication more robust, improving the reliability and intelligence of sending chat messages (including file uploads), and accurately tracking context usage for budget enforcement. This allows Deep Research to dynamically add micro-steps (adaptive research) to the plan on the fly, similar to Claude, ChatGPT, and Gemini, allowing for longer research runs and better results, while handling edge cases such as overflowing message length and chat context length.Other changes:
Search Deduplication and Options Handling
normalizeSearchKeyPartandgetSearchDedupeKeyfunctions to ensure search queries are deduplicated based on normalized query, purpose, and source type, making deduplication more accurate and context-aware. UpdatedhandleAutoSearchandhandleAutoSearchForRunto use these keys and to accept and propagate additional options such aspurposeandsourceType. [1] [2] [3]Enhanced File and Message Sending
sendFileWithMessageandsendTextWithOverLimitFallbacksto try multiple fallback texts if the initial message exceeds input limits, and improved file reading robustness with a newreadFileTexthelper. [1] [2] [3]Robust Send Button Detection and Sending Logic
Context Budget Tracking
src/content/bridge.jsto record both outgoing context (hidden prompt injections) and server-reported token usage for conversations when context guard is enabled, improving the accuracy of budget enforcement. [1] [2] [3]EDIT: I used 128K context because this is what several online sources say the chat length limit is on the website. Models have 1M context, supposedly, but I run into chat length limits too soon for this to be actually true for what's in the backend of the website. Feel free to change the numbers in the code, though.