Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 3.41 KB

File metadata and controls

56 lines (40 loc) · 3.41 KB

Roo Code Review

Overview

Roo Code is a core reference system because it exposes strong signals around runtime state, permissions, tool orchestration, and user-visible task progression.

Why It Matters

  • Strong evidence for explicit state modeling.
  • Strong evidence for permission and approval boundaries.
  • Useful for studying the coupling between runtime state and UI state.

Source-Backed Findings

  1. Roo exposes an explicit agent state model in its CLI layer. AgentLoopState includes no_task, running, streaming, waiting_for_input, idle, and resumable, and AgentStateInfo attaches a requiredAction field rather than forcing the UI to infer control state from raw messages.
  2. Roo treats completion as a first-class tool and not just an assistant utterance. AttemptCompletionTool owns completion flow, partial completion streaming, user confirmation, telemetry, and task-completed event emission.
  3. Completion is guarded. Roo blocks attempt_completion when a tool failed in the current turn and can also block completion when open todos remain if preventCompletionWithOpenTodos is enabled.
  4. Permission handling is explicit. Auto-approval logic distinguishes between approve, deny, and ask, and the CLI settings surface requireApproval and one-shot task completion behavior.
  5. Context management is a runtime concern. Task.attemptApiRequest() checks whether context management is likely to run before the next request, and the context-management layer estimates token use and condenses state when thresholds are crossed.

Evidence

  • Explicit state machine: apps/cli/src/agent/agent-state.ts defines AgentLoopState, RequiredAction, and detectAgentState().
  • State exposed to product shell: apps/cli/src/agent/extension-client.ts exposes getAgentState(), getCurrentState(), and helpers like isWaitingForInput().
  • Completion as first-class tool: src/core/tools/AttemptCompletionTool.ts and src/core/prompts/tools/native-tools/attempt_completion.ts.
  • Completion guardrails: src/core/tools/AttemptCompletionTool.ts and src/core/tools/__tests__/attemptCompletionTool.spec.ts.
  • Permission model: src/core/auto-approval/index.ts and apps/cli/src/types/types.ts.
  • Context management: src/core/task/Task.ts and src/core/context-management/index.ts.

Reusable Pattern Candidates

  • Runtime-state exposure to product shell.
  • Guarded completion.
  • Structured permission boundaries.
  • Required-action modeling separate from transcript text.
  • Compaction as a first-class runtime behavior.

Product-Specific Artifacts To Avoid Generalizing

  • Roo-specific command surfaces.
  • UI wording or mode branding.
  • Roo-specific event names and settings layout.

Current Confidence

high-confidence convergence for explicit state, guarded completion, and permission boundaries.

Source Notes