Skip to content

Command System

The Command System lets users quickly trigger specific features using /command syntax. Type text starting with /, and the frontend automatically identifies the command name and arguments, dispatching them to the corresponding handler — as efficient as a terminal command line.

Commands are dispatched through different handling modes based on their implementation:

Handling ModeDescriptionExample
Frontend Direct HandlingFrontend switch case matches the command name, executes local logic or sends RPC to the backend/compact: Frontend sends RPC to call the backend compression API
Special Prefix HandlingFrontend recognizes command prefix, generates a special message (isMeta: true) for the AI/goal: Generates a goal-setting message for AI to understand the task objective
Custom CommandsHost application registers custom commands via API; frontend matches and calls the registered handler functionAny custom command registered by the host

Parsing rules:

  • The first word after / is the command name
  • The rest is the arguments (passed as raw string)
  • Command name matching priority: exact match > alias match

Commands come from two sources: system built-in commands (/compact, /goal) and custom commands registered by the host application via API.


Exposes the existing auto-compression capability, allowing users to proactively trigger context compression to free up token space.

ParameterRequiredDescription
Custom instructionNoCustom summarization instruction that overrides the default compression prompt
Key RuleDescription
Asynchronous ExecutionCompression goes through a queue, does not block the current conversation
Completion NotificationPushes a notification via the Live channel when compression completes
Duplicate PreventionRepeated triggers are blocked while compression is in progress
Result FeedbackReturns {Success: true} upon completion, with notification pushed via the Live channel

⚠️ This feature is still in the planning stage and has not been implemented. The following describes the design proposal.

Users describe tasks that need to be executed in a loop using natural language. The Agent understands the intent and selects the appropriate loop mode for execution.

Scheduled LoopDynamic Loop
Trigger MethodFixed time intervalGoal-driven, round-based
Use CaseMonitoring deployments, polling statusTest iteration, code optimization, batch processing
Design ApproachFrontend manages timerSystem manages round state

The user sets a completion condition, and the AI works continuously until the condition is met. During execution, the AI self-assesses whether the goal has been achieved, declaring completion via the complete_goal tool, or cancelling via the cancel_goal tool.

During execution, the AI continuously evaluates the goal’s completion status. When the AI determines the goal has been achieved, it calls the complete_goal tool to declare completion; when the AI determines the goal cannot be achieved or needs to be cancelled, it calls the cancel_goal tool.

ComponentResponsibility
AIPerforms work and self-assesses whether the goal is achieved, declaring state changes via complete_goal/cancel_goal tools

A Goal is an entity independent of the Session, with its own lifecycle:

StateDescription
ActiveGoal is active, AI continues working
CompletedAI declared condition achieved via complete_goal
CancelledUser manually cancelled
ExhaustedExceeded maximum round limit (default: 50 rounds)
ElementDescription
Status BarDisplays a summary of the current goal condition
Overlay PanelShows rounds executed, cumulative tokens, and runtime
Completion NotificationPops up a notification when the goal is achieved
CommandDescription
/goalDisplay current goal
/goal <condition>Set a goal
/goal clearClear the goal
Key RuleDescription
Single GoalOnly one active goal per session
Session-scopedGoals are only valid within the current session
Safety LimitMaximum round limit (default: 50 rounds) to prevent runaway execution

After command execution, the frontend provides feedback to the user via Toast notifications.

Command Feedback:

ScenarioFeedback Method
Command executed successfullyToast notification ✅
Command execution failedToast error message ❌
  • Skill System — Learn how the host registers custom functions to extend AI capabilities
  • RTC Protocol — Learn about the remote tool calling mechanism behind commands
  • Session Management — Learn about the session context in which commands operate