Skip to content

Interactive Workflows ​

Kompile's chat harness pairs interactive numbered wizards with / commands and MCP tools so you can run long-lived, multi-agent, resource-safe, and policy-governed workflows directly from the terminal — without memorizing command flags.

Wizard-First Rule

Almost every configuration command opens a numbered interactive wizard when run bare (or with init/setup/create): /onboard, /setup, /auth, /model, /subagent-config, /workflow create, /roles, /policy-enforce, /enforcer init, /resources setup, /ui, and kompile configure. The explicit subcommands shown below are optional shortcuts for scripts and power users.

1. Onboarding & Environment Inspection ​

Run /onboard (or kompile onboard) on a fresh machine to detect external agent CLIs (claude, codex, opencode, agy), configure credentials, import existing conversation histories, and register TLS peers.

Use /explain anytime to audit what is active:

text
/explain all          # full inventory of install, harnesses, auth, limits, LSP, peers
/explain subagents    # concurrency caps, token/time budgets, model bans, failover
/explain enforcer     # active project rules, resource policy, and judge mode
/explain mcp          # configured MCP servers and injected tool surface

2. Workflow Teams & Deterministic Gates ​

Use /workflow to define multi-participant agent teams with explicit delegation edges, per-participant models, and human-in-the-loop approval gates.

Interactive wizard (recommended): run /workflow create to step through numbered pickers for workflow name → participants (with inline role creation) → lead → delegation edges → routing purposes → concurrency limit → approval gates → participant models → save — no hand-editing chat-workflows.json.

Quick inspection & gate commands:

text
/workflow create              # interactive numbered team-creation wizard
/workflow list                # list saved teams and their participant models
/workflow show                # inspect the active team, gates, and routing
/workflow model               # interactively change a participant's model
/workflow approve [gate]      # approve the next pending gate (or a named gate)

For single-agent deterministic guardrails (requiring specific skills/memories to be loaded and a plan before file mutation), configure workflow policy through /judge workflow:

  • off — disabled.
  • advisory — warns the agent when a required skill, required memory (project:file.md or global:file.md), or plan step is skipped.
  • enforced — blocks mutating actions until prerequisites are met, retrying up to workflowMaxCorrections (default 2, max 8).

3. Multi-Agent Delegation & Progress Reports ​

Kompile exposes three delegation primitives (task, multi_task, quorum_task) plus live inspection and resumption:

  • Control budgets & safety with the /subagent-config wizard (recommended):
    • Run bare /subagent-config to open the interactive numbered settings wizard (concurrency caps, token/USD/active-runtime budgets, model bans, routes, crash auto-resume, tool preloading, and prompt controls).
    • Run /subagent-config failover to open the interactive fallback-ladder wizard.
    • Direct shortcuts (for quick tweaks or scripting):
    text
    /subagent-config                    # interactive numbered settings wizard
    /subagent-config failover           # interactive fallback-ladder wizard
    /subagent-config status             # print current settings without opening the menu
    /subagent-config max 4              # direct shortcut: cap concurrent children
    /subagent-config ban *opus*         # direct shortcut: glob-ban models for subagents
    /subagent-config cost-budget 2.00   # direct shortcut: USD ceiling per subagent
  • Enforce durable handoffs: every subagent launched via task, multi_task, or quorum_task must post a report through the progress tool before its exit is accepted.
    • Read the latest main reports: /progress-reports [n]
    • Read subagent reports only: /progress-reports-subagents [n]
  • Inspect live children & token usage:
    • task_transcript (MCP tool) renders the parent/child tree and live output tail of active or completed background subagents.
    • /subagent-breakdown breaks down where a subagent spent tokens (startup prompt, skills, tool schemas, tool results).
    • subagent_resume continues any saved child conversation with the same or a different agent.

4. Scheduled Loops, Broadcasts & Auto-Continue ​

Automate monitoring, periodic checks, and multi-session coordination:

text
/loop                         # session-scoped recurring prompt
/loop-global                  # project-scoped recurring prompt
/loop-bounded                 # recurring prompt that stops after N runs or duration
/loop-broadcast               # recurring message broadcast to every other active agent
/message-broadcast <text>     # queue a one-shot message to every other active agent

Pair loops with /continue and /reminder for unattended runs:

  • /continue on auto-replies when an agent pauses with a routine confirmation question; tune keywords with /continue-trigger.
  • /reminder (session) and /reminder-global (project) inject short standing rules into every turn so agents never drift from project invariants.

5. Live Judge, Policy Audits & Rollback ​

Kompile separates inline guardrails, periodic policy audits, and tool hooks:

LayerInteractive WizardDirect CommandsWhat it enforces
Judge / EnforcerBare /enforcer (/judge), /enforcer init, kompile configure enforcer, kompile configure judge/judge status|on|off, /judge-global, /judge direction, /judge memory onReal-time rule checks, goal-drift direction checks, memory-before-response mandate, and interactive judge chat (/judge chat).
Periodic Policy AuditBare /policy-enforce or /policy-enforce-global/policy-enforce status|runStaged terminal editor for project/session policy items, turn/time triggers, and auditor model. See Policy Enforce.
Tool HooksAsk your agent (hooks tool) or /hooks/hooks list|add|edit|disable|deleteDeterministic pre/post tool hooks stored in .kompile/hooks.json or ~/.kompile/hooks.json. See Hooks.
Diff Archive & Rollback—/archive, /diff, /rollbackInspect diffs from enforced turns and roll back unwanted mutations safely.

6. Resource Admission, Reactive Monitors & Live Telemetry ​

Protect shared dev boxes and GPUs — and eliminate wasteful sleep / timeout polling loops — when running builds, test suites, or multiple agents concurrently (see Monitors & Reactive Wake-Ups for the full architecture):

  1. Classify heavy commands with the /resources setup wizard (backed by ~/.kompile/resource-policy.json and .kompile/resource-policy.json):
    • Run /resources setup (or /resources add) to walk through numbered prompts for scope (project/user), rule name, executable, optional argument prefix, and class (high vs. low).
    • Direct shortcuts:
    text
    /resources setup                           # interactive guided rule wizard
    /resources rule mvn-build high mvn         # direct shortcut: add one rule
    /resources check "mvn -pl :kompile-cli-main test"
    Commands classed high are admitted through the shared activity lane and RAM/GPU guards. When blocked, the agent receives resourceWaitId and wakeSupported=true so it can pause cleanly and resume automatically once resources free up. See Resource Policies.
  2. Use event-driven monitors & bound runtimes with process, process_notify, edit_coordinator, and /process-config:
    • Every process action=launch automatically arms a completion monitor (with optional monitor_message and host-side timeout_minutes) so the harness wakes the agent when the command exits — the Enforcer bans shell sleep, wait loops, and timeout <duration> <cmd>.
    • Subscribe to another session's shared-pool process with process action=monitor / process_notify, or watch a peer-held file lock with edit_coordinator action=monitor_edit (advisory wake — re-run query_edits before registering).
    • Inspect or cancel active completion monitors from chat with /process-monitors list and /process-monitors cancel <id> (or Cancel wake-up in Web /processes), and set host defaults with /process-config:
    text
    /process-config set maxRuntimeMinutes 20
    /process-config set testTimeoutMinutes 30
    /process-config set maxConcurrent 4
  3. Inspect live telemetry & logs:
    • /resource-monitor — live CPU, RSS, GPU, and managed subprocess view (with kill <id> confirm).
    • /process-logs tail <id> 100 or /process-logs grep <id> ERROR — inspect managed process, runtime, subprocess, and LSP logs.
    • /dashboard & /dashboard-<topic> (tools, judge, tests, disk, messages, crawl, graph, tokens, tasks, processes, timeline) — structured session diagnostics.
    • /cost & /usage — dollar cost and vendor quota window breakdown by main vs. subagents, model, and vendor.

7. Context Hygiene, Recovery & Store GC ​

  • Compaction: run /compact manually, /compact reviewed to retire specific completed topics, or /auto-compact for automatic model-aware compaction.
  • Session Recovery: use /recover status|reload|fork to reload a session journal from disk or fork into a new session without losing transcript state; /resume and /resume-all restore prior or crashed sessions.
  • Cross-Machine Sources: /sources and /blob-store unify local directories, external harnesses, encrypted TLS peers (Peer Sync), and remote blob stores (s3, filesystem, kompile-http).
  • Store Cleanup: /gc inspects Kompile home stores (dry-run by default), /gc run --yes cleans reversible stores, /gc chats packs old sessions, and /gc pin <id> protects important sessions. See Chat.

Released under the Apache-2.0 License.