fix: harden split planning flow and sanitize polluted outputs#35
Open
Boulea7 wants to merge 1 commit intoGuDaStudio:mainfrom
Open
fix: harden split planning flow and sanitize polluted outputs#35Boulea7 wants to merge 1 commit intoGuDaStudio:mainfrom
Boulea7 wants to merge 1 commit intoGuDaStudio:mainfrom
Conversation
Author
|
konbakuyomu
pushed a commit
to konbakuyomu/GrokSearch
that referenced
this pull request
Mar 17, 2026
…guards - Rename package from grok_search to smart_search (src layout) - Add Exa neural search integration (exa_search, exa_find_similar) - Add 6-phase search planning engine with phase ordering guards - Add output sanitization (strip <think> tags and refusal prefixes) - Add Tavily/Firecrawl integration for web_fetch and web_map - Add structured session-not-found errors for planning tools - Add search prompt hardening against prompt injection
konbakuyomu
pushed a commit
to konbakuyomu/GrokSearch
that referenced
this pull request
Mar 17, 2026
- Add planning phase guards and output sanitization to feature list - Add GROK_OUTPUT_CLEANUP env var documentation - Update architecture diagram with planning.py and sources.py - Add acknowledgements section crediting upstream grok-search and PR GuDaStudio#35 author - Sync English README with new features and credits
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.
Summary
This PR keeps the current split planning design intact and avoids reintroducing a single
search_planningMCP tool.Main branch history shows that
search_planningwas intentionally split into the 6 scalarplan_*tools inv1.8.0for downstream client compatibility, so this patch focuses on minimal hardening of the current design instead of reversing it.What changed
PlanningEngine.process_phaselevel=1/level=2reset()helper for isolated testssession_idfailure feedback in the existingplan_*tools:expected_phase_orderrestart_from_intent_analysis=trueweb_searchoutputs without changing the provider flow:<think>blocksGROK_OUTPUT_CLEANUP/GROK_FILTER_THINK_TAGS.gitignorefor local secrets / caches / logsWhy this scope
I intentionally did not:
search_planningtoolREADME.md/docs/README_EN.mdThis keeps the PR aligned with the current main-branch direction and reduces review risk.
Test Report
Automated
python3 -m py_compile src/grok_search/*.py src/grok_search/providers/*.py tests/*.pyuv run --directory /Users/jialinli/GrokSearch --with pytest --with pytest-asyncio pytest -q9 passed)Manual
plan_intent -> plan_complexity -> plan_sub_queryplan_sub_querybeforeplan_complexitynow returns a structured error withexpected_phase_orderweb_search("What is OpenAI? Please answer concisely.", extra_sources=20)run against a live Grok/Tavily/Firecrawl setup:<think>or refusal prefixesSafety / Privacy
git diff --check