| fix(router): preserve session store across config reloads and strengthen judge prompt
- Allow external SessionRouterStore injection via RouterRuntimeDeps so the
store survives config-reload cycles that destroy and recreate RouterRuntime
- Skip clearing externally-owned store on shutdown()
- Remove deterministic isShortContinuation bypass; let the judge LLM decide
- Strengthen judge prompt with CRITICAL RULE for continuation messages so
the model correctly inherits the previous tier instead of downgrading
Co-authored-by: Cursor <cursoragent@cursor.com>
| 14 天前 |
| feat(router): introduce in-process router module with scenario routing, fallback, and zero-usage retry
Replace the agent's direct model dependency and AgentRecoveryPolicy with a
new src/router/ module that owns scenario decision, sticky session state,
fallback chain, zero-usage retry, and (skeleton) tokenSaver / orchestrate /
customRouter / stats. Wire it into PolitConfig, createLocalGateway, and the
agent loop; update e2e + agent test helpers; add docs/router/ and full
tests/router/ unit suites.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 24 天前 |
| fix(router): preserve session store across config reloads and strengthen judge prompt
- Allow external SessionRouterStore injection via RouterRuntimeDeps so the
store survives config-reload cycles that destroy and recreate RouterRuntime
- Skip clearing externally-owned store on shutdown()
- Remove deterministic isShortContinuation bypass; let the judge LLM decide
- Strengthen judge prompt with CRITICAL RULE for continuation messages so
the model correctly inherits the previous tier instead of downgrading
Co-authored-by: Cursor <cursoragent@cursor.com>
| 14 天前 |
| fix(router): prevent duplicate content yield and harden tokenSaver judge
- Track lastHasYieldedContent to avoid re-yielding buffered events on fallback
when the primary attempt already streamed content to the caller
- Add retry loop (max 2 attempts) in classifyAndRoute for empty/unparseable
judge responses before falling back to defaultTier
- Strip markdown code fences from judge output before parsing tier tag
- Add tests for code-fence stripping, empty-response retry, and double-empty
fallback
Co-authored-by: Cursor <cursoragent@cursor.com>
| 19 天前 |