| feat: improve attachment and tool result handling
Co-authored-by: Cursor <cursoragent@cursor.com>
| 15 天前 |
| refactor: rename Polit/PolitDeck to Pilot/PilotDeck across entire codebase
Automated global rename covering all case variants:
- PolitDeck → PilotDeck, politdeck → pilotdeck, POLITDECK → PILOTDECK
- Polit → Pilot, polit → pilot, POLIT → PILOT, politDeck → pilotDeck
Includes:
- 648 content replacements across 200+ source files
- 24 file renames + 3 directory renames (src/polit→pilot, tests/polit→pilot, docs/polit-config→pilot-config)
- package.json name, bin, env vars updated
- package-lock.json regenerated
- "Politely" in server-manager.ts preserved via placeholder mechanism
- All 587 unit tests pass, tsc --noEmit clean
- E2E tests verified against real OpenRouter API (model, tool-use, context, lifecycle hooks)
Co-authored-by: Cursor <cursoragent@cursor.com>
| 24 天前 |
| feat(image): add truncated image validation and multimodal error recovery
- readFile: validate image integrity via EOI marker / sharp decode, attempt re-encode on corruption
- model errors: detect 'failed to apply processor' pattern, mark recoverableViaImageStrip
- context recovery: new strip_images_and_retry decision path
- agent loop: handle strip_images_and_retry by replacing image blocks with text placeholders
- fallback chain: exclude image-strip-recoverable errors from model fallback
Co-authored-by: Cursor <cursoragent@cursor.com>
| 12 天前 |
| fix(router): case-insensitive tool filtering and trim redundant prompt section
Make allowedTools/blockedTools matching case-insensitive to avoid misses
when tool names differ in casing. Fall back to unfiltered tools when
allowedTools matches nothing. Remove the agent tool call schema section
from DEFAULT_ORCHESTRATION_PROMPT (already documented in tool definition).
Co-authored-by: Cursor <cursoragent@cursor.com>
| 15 天前 |
| feat(router): add subagentModel override for orchestrated sub-agents
Allow autoOrchestrate config to specify a subagentModel that forces all
spawned sub-agents to use a specific model, enabling cost-optimized
"big model orchestrates, small model executes" patterns. Also fix
tokenSaver selection adoption to respect sticky/fallback results.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 18 天前 |
| 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 天前 |
| refactor(router): simplify scenarios and config schema
- Remove unused scenario types: background, think, longContext, webSearch
- Delete longContextThreshold.ts entirely (logic no longer needed)
- Simplify subagent policy to skip/judge (remove inherit/fixed)
- Add allowedTools whitelist and optional blockedTools to orchestrate config
- Add DEFAULT_SUBAGENT_POLICY, DEFAULT_SUBAGENT_MAX_TOKENS, DEFAULT_ALLOWED_TOOLS
- Clean up parseRouterConfig to match simplified schema
Co-authored-by: Cursor <cursoragent@cursor.com>
| 22 天前 |
| 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 天前 |
| refactor: enhance token usage normalization and cost calculations
Updated the normalizeOpenAIUsage function to improve token calculations by introducing cache read and write tokens. Adjusted the TokenStatsCollector to account for cache write costs in total calculations and refined baseline cost handling. This ensures more accurate cost estimations and better reflects usage metrics.
| 12 天前 |
| 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: improve attachment and tool result handling
Co-authored-by: Cursor <cursoragent@cursor.com>
| 15 天前 |
| 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): add invalidateSticky and previousTier support
Clear routing sticky at the start of each new user turn so the judge
re-classifies fresh messages instead of reusing a stale tier. Pass
previousTier into the judge prompt so short continuation messages
(e.g. "继续", "go on") prefer keeping the previous tier.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 19 天前 |