fix(agent): re-anchor before session_search for ambiguous continuations - #30502
fix(agent): re-anchor before session_search for ambiguous continuations#30502ilonagaja509-glitch wants to merge 1 commit into
Conversation
SESSION_SEARCH_GUIDANCE previously encouraged session_search whenever
cross-session context might exist, but did not distinguish between:
- explicit historical recall (session_search appropriate)
- ambiguous continuation requests in gateway threads ('continue', 'remaining work')
For ambiguous continuations, the agent should first re-anchor on the
current session/thread/project state before reaching for session_search.
This prevents cross-thread retrieval from being treated as the active
task context.
Updates SESSION_SEARCH_GUIDANCE to include re-anchoring rule while
preserving cross-session recall capability. Adds test asserting the
new guidance includes re-anchoring and ambiguous continuation handling.
Fixes NousResearch#30498
keegoid-codex
left a comment
There was a problem hiding this comment.
Severity
- [CAT-3] low. Prompt guidance and substring-only tests change no runtime contract.
VERDICT: approve
codex-review posting override: forced to --comment because reviewer lacks verified write permission (viewerPermission=READ; was --approve). GitHub only counts approvals from WRITE, MAINTAIN, or ADMIN reviewers.
|
[DEV SecOps] verdict: PASS
|
|
[DEV SecOps] verdict: PASS
|
|
Thanks for putting this together. I agree with the direction here: the re-anchor guidance is a useful prompt-level mitigation for ambiguous continuation requests. I opened #70105 as the runtime/tool-layer follow-up for the same failure mode. The gap this PR cannot close by itself is that #70105 keeps this re-anchor idea but adds the enforceable provenance/scoping layer: chat-origin metadata in So I see the two as complementary: this PR improves the guidance, and #70105 makes the default enforceable at the tool layer. Happy to rebase #70105 around whatever lands first, or trim the overlapping prompt-guidance lines there if maintainers prefer to land this smaller guidance PR separately. |
Fixes #30498
Problem
SESSION_SEARCH_GUIDANCEencouragedsession_searchwhenever cross-session context might exist, but did not distinguish between:session_searchshould be used)For ambiguous continuations like "continue", "remaining work", or "what were we doing" in a gateway thread, the agent could pick a cross-thread search result and treat it as the active task context, leading to incorrect file edits or status reports.
Solution
Update
SESSION_SEARCH_GUIDANCEto include re-anchoring rule:session_searchas cross-session history lookup, not the source of truth for ambiguous continuationssession_searchafterward for explicitly historical contextTests
Added test
test_session_search_guidance_requires_reanchoring_for_ambiguous_continuationsasserting the new guidance includes: