Files
context-mode/tests
Mert Koseoglu f2628529d9 fix(session): stop casual phrases freezing as re-injected behavioral_directive (#856)
Defense-in-depth fix for the pi/omp do-nothing loop where a casual past
phrase ("that's fine for now") froze as a priority-3 role and got
re-injected as a standing <behavioral_directive> every turn.

1. Classifier (extract.ts): require a persona/standing-directive cue
   (algorithmic prefix membership, no regex) so conversational
   acknowledgements no longer classify as role. Legitimate multilingual
   role prompts (issue #535 corpus) and directives ("always respond in
   TypeScript", "act as a security reviewer") still classify.

2. Pi injection (adapters/pi/extension.ts): filter role out of the
   per-turn before_agent_start active_memory injection. Roles stay in the
   DB and queryable via ctx_search; intent/skills/decisions/resume
   snapshot are unaffected. Removes the dead behavioralDirective extract.

3. Framing (hooks/routing-block.mjs): soften session_continuity so a
   captured snapshot is a memory aid, not an inescapable 'active until
   revoked' standing order; the user's latest message takes precedence.

RED->GREEN tests per slice; no new regex; typecheck green.
2026-06-22 11:02:21 +03:00
..