The idea: a plan, an executor, and a check

Planning records the steps of one task. Deep research adds repeated research and validation cycles. Automatic orchestration chooses execution behavior and tracks progress, dependencies, acceptance, and budgets. An outer loop can continue coding work over multiple cycles; it needs explicit stopping limits.

Start by producing a plan you can read:

mini-a planmode=true planfile=review-plan.md \
  goal="Plan a review of installation documentation. Include how to check each result."

This writes a plan and exits without executing its proposed tasks. To run a plan-based task, use useplanning=true with the plan file and the tools the work needs. A plan is not evidence that the work has happened.

Add automatic orchestration only after a simple task works. Use runmaxtokens and runmaxtimems to bound admission of more work; already-running calls may exceed estimates. Supervised contracts specify concrete acceptance requirements. Delegation is useful when subtasks can run independently.

Planning & Multi-Agent Delegation

For complex goals, mini-a can plan a series of steps before executing them, and optionally delegate subtasks to child agents or remote workers.

Think of delegation as an orchestration layer: one parent agent manages task decomposition, parallel execution, and result aggregation across multiple workers.

Planning Styles

Style Description
simple Flat sequential steps — generates and executes one step at a time (default)
legacy Phase-based hierarchical planning — creates a structured multi-phase plan upfront
# Enable planning (simple style, default)
mini-a useplanning=true

# Use legacy hierarchical planning
mini-a useplanning=true planstyle=legacy

Delegation

When delegation is enabled, the main agent can spawn child agents to handle independent subtasks in parallel.

# Enable delegation to child agents
mini-a usedelegation=true

Delegation also works with remote workers — the main agent can send subtasks to mini-a instances running in worker mode on other machines.

Worker registration is also supported: set workerreg to a port to have mini-a start a worker registration HTTP server, optionally protected by workerregtoken. Use workerevictionttl to evict stale worker entries, and delegationmaxdepth to cap recursive delegation chains.

Worker Skills (A2A)

Workers can advertise same-process submission recovery. If a submission response is lost, Mini-A looks up its retained receipt instead of replaying execution; expired receipts and worker restarts retain an explicit unknown outcome. See worker recovery.

Workers can advertise specific capabilities as A2A skills. The parent reads each worker’s /.well-known/agent.json AgentCard and uses declared skills to route subtasks intelligently.

# Start a shell-capable worker (auto-emits the "shell" A2A skill)
mini-a workermode=true onport=9091 shellworker=true

# Start a worker with custom skills
mini-a workermode=true onport=9092 \
  workerskills="shell,time" \
  workerspecialties="finance,data-analysis"

The delegate-subtask tool call can then request specific skills:

{ "goal": "run the test suite", "skills": ["shell"] }

When dynamic worker registration is active (workerreg=<port>), the parent rebuilds the delegate-subtask tool description every 30 seconds (or immediately on profile change) to list available workers and their skills — so the LLM always routes to the right worker without guessing.

Orchestration Pattern

Use this pattern when you want mini-a to coordinate multiple agents for larger workloads:

  1. Start one or more worker instances (mini-a workermode=true onport=9090).
  2. Run a parent agent with planning and delegation enabled.
  3. Set concurrency limits so execution stays predictable.
  4. Let the parent combine worker outputs into a single final result.
mini-a useplanning=true planstyle=legacy usedelegation=true \
  workers='http://worker1:9090,http://worker2:9090' maxconcurrent=4 \
  goal='Analyze this monorepo, group findings by domain, and produce one prioritized action plan'

Live Coordination Between Agents

Delegated agents are isolated by default: they exchange only a goal and a result. With agentcomms, agents in one delegation tree can also relay early findings to a parent, message peers, publish to topics, or claim work through version-checked shared state, all without a broker or an extra model. Each capability needs an explicit grant, grants are never inherited, and remote workers must opt in with apitoken and their own ceiling. See Advanced → Inter-agent communication.

Adaptive Orchestration

A configured modeldec/OAF_DECIDE_MODEL can refine ambiguous complexity and rank dynamic/capability selections. Explicit usedecide=true enables selected verdict gates and the conditional automatic-skill default; usedecide=false disables calls. Failures retain existing paths. See decision integration.

orchestration=auto lets Mini-A choose planning, advisor/model strategy, and evidence-gating controls from deterministic goal-complexity and risk signals, with optional bounded decision-model refinement. It also tracks progress, checks delegated task contracts before accepting them, and can enforce aggregate runmaxtokens/runmaxtimems budgets. manual stays the default, explicit flags always win, and every automatic decision is recorded in the trace. See Advanced → Adaptive orchestration.


Outer Loop Autonomous Coding

For tasks that require multiple revision cycles, mini-a supports an autonomous outer loop that runs the agent repeatedly until the goal is validated or safety limits are reached. Each cycle starts with fresh context while persisting state under ~/.openaf-mini-a/sessions/<session-id>/.

mini-a "Implement the feature described in ./TASKS.md" \
  outerloop=true \
  useplanning=true \
  outerloopinstructions=./TASKS.md \
  valgoal="All implementation tasks complete and tests pass" \
  outerloopmaxcycles=8

The loop stops automatically when:

  • Completion and validation succeed
  • The maximum cycle count (outerloopmaxcycles, default 5) is reached
  • The runtime limit (outerloopmaxtime) expires
  • The same validation failure repeats (outerloopstoponrepeat=true)
  • No meaningful change occurs for N consecutive cycles (outerloopmaxnochange, default 2)

Session Persistence

Each cycle saves artifacts to the session directory: instructions.md, state.json, plan.md, last-validation.txt, last-error.txt, cycle-000N-summary.md, and changed-files.json.

To resume an interrupted outer loop run, pass the session ID that was printed at startup:

mini-a "Refactor the parser and keep iterating until validation passes" \
  outerloop=true \
  outerloopsessionid=session-20240601-120000-abc123 \
  valgoal="Parser tests pass and no regression is introduced" \
  outerloopmaxcycles=6

See Configuration → Outer Loop for the full parameter reference.


Planning Workflows

mini-a can generate and follow structured plans before executing tasks, improving reliability for complex multi-step goals.

Enabling Planning

mini-a useplanning=true

When planning is enabled, mini-a first creates a plan of action, then executes each step sequentially, tracking progress along the way.

Plan Styles

The planstyle parameter controls how plans are generated:

Style Behavior
simple Flat sequential plan steps. The agent creates numbered steps upfront and executes them in order. This is the default.
legacy Phase-based hierarchical planning. The agent groups steps into phases before executing.
mini-a useplanning=true planstyle=legacy

Saving Plans

Save generated plans to a file for review or reuse:

mini-a useplanning=true planfile=my-plan.yaml

Inspect returned thought logs

Use showthinking=true only when your provider returns XML-tagged thinking blocks. It surfaces those blocks as diagnostic logs; it does not expose a model’s private reasoning. This path uses raw prompt calls.


Adaptive Orchestration

orchestration=manual is the default and preserves current behavior. orchestration=auto applies goal-complexity and risk heuristics to the existing planning, advisor/model-strategy, and evidence-gate controls. A configured decision model may refine ambiguous complexity and assist bounded execution decisions.

mini-a goal="Migrate the billing service and update its tests" orchestration=auto

Explicit flags such as useplanning=false, modelstrategy=default, and evidencegate=false always win. Each automatic decision is emitted through the trace sink as an orchestration_decision record (visible in durable run traces).

orchestrationcontext=auto treats console and web sessions as interactive, and direct jobs and workers as batch; set it explicitly to override. Automatic selection never picks supervised mode for interactive sessions. In batch it does so only for a complex goal with a deliverable and a verification signal.

Progress guard and recovery

In automatic mode, progress is measured by new relevant tool evidence and accepted task results. Repeating a successful call with unchanged output doesn’t count. After four active steps without progress, Mini-A asks for a changed approach, and two failed recoveries leave the goal blocked. Time spent waiting for children doesn’t count, but delegation timeouts still apply.

With usedecide=true and a decision model, automatic execution can also recommend a recovery, skip a low-value summary delegation, or accept eligible read-only evidence without a generative review. These optional calls are capped at eight per run, five seconds each and fifteen seconds in total, and two consecutive failures disable them.

Task contracts and dependencies

delegate-subtask accepts an optional task contract with dependencies, resource scopes and acceptance criteria:

{
  "goal": "Read the revenue data and return the total",
  "task": {
    "id": "revenue",
    "dependencies": [],
    "resources": { "reads": ["reports/revenue.json"], "writes": [] },
    "criteria": [
      { "id": "total", "requirement": "Return the requested total", "method": "semantic" }
    ]
  }
}
  • A dependent task starts only after its predecessors are accepted. execution-task with action=status shows the graph, and action=revise registers or revises a contract.
  • Overlapping writes serialize. An omitted scope defaults to exclusive writes:["*"], so declare independent scopes to get parallel work.
  • Criterion methods: answer (assertions on the response), artifact (a file path, optional format=json|yaml), schema, and semantic (model review, preferring modelval).
  • A completed task reports outcome (success, partial, blocked, failed, cancelled, uncertain) and acceptance (pending, accepted, rejected) separately.
  • subtask-status with waitSeconds=10 waits without repeated model polling.

When delegation is already on, automatic mode can propose two to five task contracts for a multi-step goal that has no plan yet. It first asks the decision model whether splitting is worthwhile, then validates and checkpoints the graph. There is at most one attempt per goal, and children don’t decompose recursively. Remote automatic decomposition requires workers that advertise compute-only-v1, prepared-context-v1 and task-outcome-v1; file-scoped tasks also need scoped-files-v1.

Run budgets and acceptance

Parameter Default Description
runmaxtokens 0 (unlimited) Aggregate token admission across the agent tree; 15% is reserved for review and integration
runmaxtimems 0 (unlimited) Aggregate elapsed-time admission; doesn’t interrupt calls already admitted
acceptancereview false Opt-in final-answer review; streamed answers stay provisional until accepted
acceptanceoptimization true Skip semantic review when a required deterministic check has already failed
proxyargrepair true Repair a missing proxy action from an exact operation: status\|list\|search

Budgets require automatic orchestration and are admission limits, not exact billing limits. With durable=true, checkpoints hold task revisions, acceptance, reservations and remote submission IDs. On resume, existing remote work is reconciled before anything new runs, and only read-only or idempotent:true tasks are retried.

Embedding applications can register an exact answer contract with agent.setAcceptanceContract({ goal, bindings }, evidenceProvider). Run ojob tests/execution.yaml for deterministic coverage, and evals/orchestration.yaml for live comparisons.