Add a `task` tool for isolated subagents with typed results

Aperta
#17 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
git, rust

Direzione di ricerca

Start with src/agent/run.rs to see how the single Core runs one session and turn loop, then src/context/mod.rs to see how tool results join the conversation path. The design needs a nested turn loop with its own context, a tool allowlist intersected with the parent's, and a typed result returned to the parent. Done means the acceptance criteria in the issue hold: children return schema-valid JSON, denied tools and nested spawning are refused, and cancel leaves no worktree or process behind.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: agent-loop enhancement priority: P2

Problem

Every investigation shares the main context. A broad search, a log dump, or a 40-file review pollutes the parent conversation and pushes it toward compaction. omp and Claude Code isolate this with subagents that return a schema-validated result; Cline's spawn approval, by contrast, lets a child inherit far more than the parent intended.

LocalHarness runs on one GPU, so subagents cannot run in parallel for speed. They are still valuable for context isolation and for enforcing a narrower tool set.

Evidence

  • src/context/mod.rs: all tool results live on one conversation path.
  • src/agent/run.rs: one Core, one session, one model per turn.
  • oh-my-pi: task fans out into worktrees and returns schema-validated objects.
  • Claude Code subagents: separate context, tool allowlist, no nested spawning.

Proposal

Add a task tool (off by default) that runs a nested turn loop:

  • Input: objective, output_schema, tools (allowlist), max_turns, isolation (readonly or worktree).
  • Child runs with a fresh context, the intersection of parent and requested tools, and no ability to spawn.
  • Result: one JSON object matching output_schema, plus an optional patch; prose is not parsed.
  • Serialize children on one GPU; max_concurrent = 1 by default.
  • Parent context receives only the typed result and a one-line summary, not the child transcript.
  • Clean up worktrees and processes on cancel.

Acceptance criteria

  • Three research children return valid JSON without adding their transcripts to the parent context.
  • A child requesting a tool outside the parent's set gets DENIED and continues.
  • A child cannot spawn another child.
  • Worktree patches apply cleanly or return a typed conflict.
  • Cancel leaves no worktree or process behind.
  • With one GPU, children run one at a time and the setting is documented.

References

Lingua principale
Rust
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GotinhaAzul/LocalHarness

Tutte le issue di GotinhaAzul/LocalHarness

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.