A polling meta-agent that watches N zellij panes (each running
claude / Claude Code) and decides when to nudge each one with a
new instruction.
- Cheap classifier every stall — LMStudio + a local Gemma reads
the pane snapshot, decides
continue/instruct/ask_user. Bounded LLM spend even over multi-week kernel-tuning sessions. - Heavy audit on demand —
/review AGENT_IDre-reads the whole memo log + a bigger pane snapshot and asks Gemini 2.5 Pro (reviewBackend) for a concrete redirection. - Multi-agent — each managed agent runs its own polling loop
via
IO.asTask, all state behindIO.Refsnapshots so the controller (TUI / REPL) reads them cheaply. - Persistent — JSON config for the agent roster + LLM backends,
per-agent JSONL memo log for
--resume.
Rendered UI:
┌────────────────────────────────────────────────────────────┐
│ meta_orchestrator — 3 agent(s) │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ kernel-bwd running pane=term_18 poll=42 [t+…]│ │
│ │ port-cuda stable pane=term_22 poll=17 [t+…]│ │
│ │ mem-audit asking-… pane=term_26 poll=3 [t+…] │ │
│ └────────────────────────────────────────────────────────┘ │
│ │
│ > /review kernel-bwd_ │
└────────────────────────────────────────────────────────────┘
- lean-tea —
LeanTea.Cloud.Gemini,LeanTea.Llm.Openai,LeanTea.Tui zellij action dump-screen/write-chars— pane I/O via CLI- FNV-1a hash of pane text — cheap stall detection
lake update
lake build meta_orchestrator
./.lake/build/bin/meta_orchestrator --config meta_orchestrator.config.json
> /add kernel-bwd terminal_18 Optimise FlashAttn v3 bwd SM90 2x throughput
> /add port-cuda terminal_22 Port the rest of the kernels from CUDA to CK
> /list
> /saveRequired env: GEMINI_API_KEY (only if reviewBackend is a gemini
kind; issue one at https://aistudio.google.com/apikey).
{
"agents": [
{"id": "kernel-bwd", "pane": "terminal_18",
"goal": "Optimise FlashAttn v3 bwd SM90 2x throughput",
"stallSec": 30, "pollSec": 5, "enabled": true}
],
"logDir": "./logs",
"decideBackend": {
"type": "openaiCompat",
"baseUrl": "http://127.0.0.1:11211/v1",
"model": "local-model"
},
"reviewBackend": {
"type": "gemini",
"model": "gemini-2.5-pro"
}
}| command | meaning |
|---|---|
/list |
show every agent + its current status |
/add ID PANE GOAL... |
register and start an agent |
/stop ID |
cooperatively stop the polling loop |
/start ID |
resume a stopped/disabled agent |
/remove ID |
drop the agent from the config |
/reply ID TEXT... |
inject a free-text reply (use when the decide backend said ask_user) |
/review ID |
run a heavy-weight audit via reviewBackend |
/save [PATH] |
persist the config to PATH |
/load PATH |
replace the in-memory config |
/quit |
stop every agent, save the config, exit |
MetaOrchestrator/
Zellij.lean — dump-screen / write-chars / submit CLI wrappers
Llm.lean — Backend union (openaiCompat | gemini) + JSON codec
Director.lean — decide (JSON verdict) + review (free-form audit) prompts
Config.lean — ManagedAgent + Config records + JSON codec
Runtime.lean — per-agent polling loop (IO.asTask + IO.Ref)
Tui.lean — full-screen TUI on LeanTea.Tui
Main.lean — controller — boots agents, TUI or REPL