Skip to main content

Module planner

Module planner 

Source

StructsΒ§

DisplayCapability πŸ”’
ExecutorConn
gRPC client for executor’s plan-dispatch contract. Pilot only ever calls Execute(Plan) β€” discovery happens directly against atlas now.
RtdlEnvelope πŸ”’
One parsed RTDL envelope from the VLM.
TaskState πŸ”’
Harness-owned state for the latest user interaction. Long-running work is represented independently by the RTDL forest; it must not keep older user text welded into the current goal forever.
TreeMeta πŸ”’
Metadata for one in-flight RTDL tree in the forest. Trees are keyed by pilot-assigned plan_id; this carries what the supervisor and the LLM need to reason about a running tree (and, later, what the chat UI renders).
TreeStep πŸ”’

EnumsΒ§

ForestEvent πŸ”’
Events fed from per-tree driver tasks back to the supervisor loop. One drive_plan task runs per dispatched tree and streams these.
MetaPlanOp πŸ”’

ConstantsΒ§

DEFAULT_SUCCESS_CRITERION πŸ”’
HISTORY_COMPACT_TRIGGER_CHARS πŸ”’
Approx history size (in chars; ~4 chars/token) past which we compact. Tuned to keep the working window small without compacting on every short turn.
HISTORY_KEEP_RECENT πŸ”’
Most recent messages always kept verbatim through a compaction.
MAX_HISTORY πŸ”’
RTDL_DO πŸ”’
RTDL_PARALLEL πŸ”’
RTDL_PROTOCOL_REMINDER πŸ”’
One-line protocol reminder sent on every round after the first. The full ~9KB rtdl_protocol.md is sent only on round 0 (and the model’s own prior envelopes stay in history), so later rounds re-anchor cheaply instead of re-shipping the whole spec β€” a large latency/token win on multi-round turns.
RTDL_SEQUENCE πŸ”’

StaticsΒ§

OP_ID_SEQ πŸ”’
Process-wide monotonic source of node op_ids. The LLM-emitted RTDL does not carry a usable op_id (it defaults to 0), so pilot assigns one itself while parsing: a globally-unique, auto-incrementing id starting at 1. β€œGlobal” = across every plan/round in this pilot process, so each node in the live task-graph forest is uniquely addressable for steering and result correlation β€” not merely unique within one plan.

FunctionsΒ§

append_plan_node_summary πŸ”’
Append one node and its descendants to the human-readable plan summary.
append_steer πŸ”’
Pull every queued mid-task steer into the LLM history as fresh user input.
apply_task_update πŸ”’
Apply only progress fields from the model. The user-owned goal is immutable within the standing task; steering is appended by the harness above. The model may refine the default success criterion once, but cannot erase or replace an established criterion. Completion is accepted only at a harness safe point with no new or in-flight execution.
build_capability_target_map πŸ”’
build_display_capabilities πŸ”’
build_executor_active_block πŸ”’
build_forest_block πŸ”’
build_rtdl_prompt πŸ”’
Build the per-round protocol + capability catalog. full_protocol ships the complete spec (round 0); otherwise a one-line reminder. The capability catalog is always included because providers can change mid-turn.
build_rtdl_retry_prompt πŸ”’
Corrective prompt appended to the next VLM round after a parse/expand failure.
build_system_prompt πŸ”’
call_display_name πŸ”’
Recover the LLM-facing capability name from an expanded capability call.
cancel_forest_plans πŸ”’
Cancel every real task tree owned by this turn before reporting the Pilot session interrupted. Dropping the Execute stream alone only detaches Pilot; Executor continues the plan (and synchronous tools such as run_command) unless its PlanRuntime receives an explicit cancel_plan request.
collect_vlm_text πŸ”’
Run one non-streaming VLM completion and return the full text (drains the stream). Returns None on any stream error.
compact_history πŸ”’
Claude-Code-style rolling compaction. When the running history grows past HISTORY_COMPACT_TRIGGER_CHARS, summarize everything except the most recent HISTORY_KEEP_RECENT messages into a single summary note (preserving goal, decisions, observations, and current state) and keep the recent turns verbatim. This shrinks the per-round prompt for the rest of the turn instead of re-shipping the full transcript every round.
compact_preview πŸ”’
Shorten free-form payloads so one log event stays readable on one line.
configured_vlm_idle_timeout πŸ”’
drain_steers πŸ”’
drive_plan πŸ”’
Drive one dispatched plan’s Execute stream to completion, forwarding node states for visualisation and collecting terminal results. Sends exactly one PlanDone when the stream ends. Runs as its own task so the supervisor loop never blocks on a single tree β€” concurrent trees form the forest.
duplicate_in_flight_signature πŸ”’
empty_sequence_plan πŸ”’
A single empty-sequence root plan, used as the no-op plan when a turn ends in RTDL recovery. Carries non-empty op_id/description so executor’s validate_plan accepts it.
execute_meta_plan_op πŸ”’
expand_rtdl_node πŸ”’
expand_rtdl_to_plan πŸ”’
extract_json_object πŸ”’
Parses one VLM reply in RTDL envelope form.
feed_results_into_history πŸ”’
Feed one finished tree’s terminal results into the LLM history, mirroring the per-round feedback the blocking loop used to produce.
fetch_executor_active_block πŸ”’
format_plan_summary πŸ”’
Format a plan as an indented tree instead of exposing arena child arrays.
invalid_cancel_target πŸ”’
is_control_only πŸ”’
Render the in-flight forest as a system-prompt block so the LLM can see what is still running and reference a plan_id to cancel it. Empty when no tree is running. Trees are ordered by numeric plan id for stable output. True when every do node is a plan-control builtin and there is at least one. Plan-control trees are not themselves cancellable task work; advertising them makes the model inspect or cancel its own control actions.
is_legacy_plan_control_contract πŸ”’
is_terminal_executor_state πŸ”’
load_agent_soul πŸ”’
log_node_state πŸ”’
Emit one readable node-state event without numeric state or kind codes.
log_plan_complete πŸ”’
Emit the readable plan completion line, including non-success terminal nodes.
log_plan_start πŸ”’
Emit the compact plan-start log block for one expanded RTDL plan.
max_tool_rounds πŸ”’
mixes_control_inspection_with_action πŸ”’
next_op_id πŸ”’
Allocate the next global op_id (1, 2, 3, …) as a decimal string.
parse_meta_plan_op πŸ”’
parse_rtdl_assistant_response πŸ”’
Tolerates a prose preamble or trailing commentary around the JSON object (a common model habit, e.g. a narration line then the JSON on the next line) by extracting the first balanced {...} before parsing; the raw string is used unchanged when no object is found, so a genuinely JSON-less reply still surfaces the original parse error.
parse_task_update πŸ”’
Parse a non-null task_update object into a TaskState.
pick_description πŸ”’
Pick a node’s description, in priority order:
plan_call_count πŸ”’
plan_call_signatures πŸ”’
plan_cancel_targets πŸ”’
plan_completion_state πŸ”’
Pick the plan-level completion state shown in the forest completion log.
plan_steps πŸ”’
raw_preview πŸ”’
reject_unknown_node_keys πŸ”’
Reject node fields outside the allowed set and require the structural ones.
rtdl_node_kind_name πŸ”’
Render an RTDL node kind as the tree operator name used in plan logs.
rtdl_recovery_final_text πŸ”’
User-facing message when RTDL recovery gives up β€” never leaks the internal error.
rtdl_result_to_messages πŸ”’
rtdl_state_name πŸ”’
Render an RTDL node state as a stable human-readable name for logs.
run_turn
should_replan_after_plan_done πŸ”’
skip_memory_prefetch πŸ”’
Skip vector memory prefetch for trivial chit-chat (saves latency and noise).
start_or_resume_task πŸ”’
task_is_session_end πŸ”’
context_json: {"session_end": true} (or robonix_session_end) β€” run memory compaction only, no VLM turn.
task_modality πŸ”’
context_json.modality β€” set by liaison to β€œtext” / β€œvoice” / β€œapi”. None when the field is missing or context_json is empty/malformed.
terminal_node_detail πŸ”’
Build compact extra detail for non-success terminal node states.
vlm_idle_timeout πŸ”’

Type AliasesΒ§

CapabilityTarget πŸ”’
CapabilityTargetMap πŸ”’