Planner¶
The planner is a conversation loop inside Core
(ADR-0020: Planner Runs In-Process in Core).
A human chats with it through the realtime API
(Planner chat); it answers with the model configured
in [planner] (Configuration), calling the tools below.
Instructions¶
The system prompt is Ballet’s built-in planner instructions, the project
and organization, and — if the project uses one — the SKILL.md of its
planner skill (planner.skill) in the version the project resolves
(pins apply, Skills). Write a planner skill to give a
project’s planner its own process rules.
Tools¶
Tool |
Does |
Needs |
|---|---|---|
|
The project’s milestones, epics and tickets; optional |
|
|
One item with description, acceptance criteria, policy and dependencies |
|
|
Ready tickets whose blockers are resolved |
|
|
Hybrid search over the project’s items and skills |
|
|
The project’s changesets, optionally by |
|
|
Propose create / update / dependency operations for the human to approve |
|
|
The project’s effective skills (name, scope, version) |
|
|
SKILL.md of a skill in the version the project uses |
|
|
Search the organization’s knowledge base; optional |
|
|
Read an entry |
|
|
Write a document, decision, note or debt record linked to the project and to items |
|
|
Change an entry (send the |
|
Each tool’s input is a JSON object described to the model by a JSON Schema; unknown fields are rejected. Outputs are JSON.
Context compaction¶
Before each model call the planner estimates the context the model would
see: the token usage the provider reported for the last answer plus the
messages added since (about four characters per token when no usage is
known). Above planner.compact_at_tokens it asks the model to
summarize everything before the latest human message (including any
earlier summary), stores the summary on the session, and from then on
sends the model that summary plus the newer messages. The current turn is
never summarized, so tool calls and their results stay together.
The transcript stays complete: the UI and
GET /api/v1/planner/sessions/{session}show every message.Each compaction records a
planner.compactedevent (up_to,estimated_tokens), sends acompactedplanner output, and increments theballet_planner_compactions_totalmetric.A failed compaction is logged and the call proceeds uncompacted.
A single turn whose own tool rounds outgrow the context cannot be compacted;
planner.max_roundsbounds it.
Limits¶
A turn ends when the model stops calling tools, after
planner.max_rounds rounds of tool calls (the human sends a message
to continue), or when the human cancels it. Model calls go through the
LLM gateway with the project’s credential and are metered to the
project (LLM Gateway).