Skip to content

feat: persist and restore codex app's tools after search#11780

Open
apanasenko-oai wants to merge 4 commits intomainfrom
anton_panasenko_search_tool_tune
Open

feat: persist and restore codex app's tools after search#11780
apanasenko-oai wants to merge 4 commits intomainfrom
anton_panasenko_search_tool_tune

Conversation

@apanasenko-oai
Copy link
Collaborator

What changed

  1. Removed per-turn MCP selection reset in core/src/tasks/mod.rs.
  2. Added SessionState::set_mcp_tool_selection(Vec<String>) in core/src/state/session.rs for authoritative restore behavior (deduped, order-preserving, empty clears).
  3. Added rollout parsing in core/src/codex.rs to recover active_selected_tools from prior search_tool_bm25 outputs:
    • tracks matching call_ids
    • parses function output text JSON
    • extracts active_selected_tools
    • latest valid payload wins
    • malformed/non-matching payloads are ignored
  4. Applied restore logic to resumed and forked startup paths in core/src/codex.rs.
  5. Updated instruction text to session/thread scope in core/templates/search_tool/tool_description.md.
  6. Expanded tests in core/tests/suite/search_tool.rs, plus unit coverage in:
    • core/src/codex.rs
    • core/src/state/session.rs

Behavior after change

  1. Search activates matched tools.
  2. Additional searches union into active selection.
  3. Selection survives new turns in the same thread.
  4. Resume/fork restores selection from rollout history.
  5. Separate threads do not inherit selection unless forked.

@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_tune branch 2 times, most recently from 057ffb8 to 3ce2a50 Compare February 14, 2026 02:59
@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_tune branch 2 times, most recently from 9b44266 to cf593f4 Compare February 15, 2026 02:50
@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_tune branch from cf593f4 to 72a92f3 Compare February 15, 2026 04:21
@apanasenko-oai apanasenko-oai force-pushed the anton_panasenko_search_tool_tune branch from 8e15e9a to 303f850 Compare February 16, 2026 00:06
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.

2 participants