| feat(agent): add circuit breaker and simplify AgentLoop internals
Terminate after 3 consecutive turns where every tool call fails input
validation (e.g. qwen emitting empty-param bash in a loop). Add the
agent_tool_error_loop error code. Also remove planFileManager injection,
syncPlanFilePath, and permissionModeOrigin tracking to simplify the loop.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 16 天前 |
| feat(agent): implement subagent status tracking and event handling
- Introduced new subagent status events including "subagent_started", "subagent_completed", and "subagent_status" to track the lifecycle and activity of subagents.
- Added functionality to emit heartbeats and update subagent status based on tool execution events.
- Enhanced the AgentLoop to manage subagent execution with an event pump, allowing for real-time status updates during tool execution.
- Updated the SubAgentSession to forward relevant events to the parent context, ensuring visibility of subagent activities.
- Adjusted the UI components to reflect subagent statuses and errors appropriately.
This update improves the monitoring and management of subagents within the agent loop, enhancing overall system responsiveness and user feedback.
| 15 天前 |
| fix(permissions): unify skip prompt handling
Persist permission settings through the backend and apply per-turn bypass mode in the gateway so skip prompts consistently reaches tool execution while preserving hard safety denies.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 20 天前 |
| feat: add tool and agent runtime foundations
Build the PolitDeck tool/permission runtime and start the agent loop on canonical model/tool contracts so future refactors can prove parity against legacy behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 26 天前 |
| feat(context): add proactive tiered auto-compaction before model calls
Introduce tryAutoCompact on DefaultContextRuntime with a three-tier
strategy (MicroCompaction → SnipEngine → full CompactionEngine) that
fires in AgentLoop before each model request when the token budget
approaches maxContextTokens.
- Extract shared tool-pair integrity helpers into toolPairIntegrity.ts
(from SnipEngine) and reuse in CompactionEngine boundary splitting
- Wire MicroCompactionEngine, SnipEngine, and ContextOverflowRecovery
into the gateway runtime construction
- Delegate overflow recovery to ContextOverflowRecovery when injected
- Add auto_compact agent-loop transition reason
Co-authored-by: Cursor <cursoragent@cursor.com>
| 21 天前 |