Skip to content

Coding-agent subagents B16: design — durable orchestration (declarative continuations vs re-entrant leaves) #401

Open

Description

@pdettori

Part of the Coding-agent subagents epic (#378). Item B16, milestone B-M4. Design only, after B-M1 and B-M2.

Goal

Decide how multi-step subagent workflows can progress while the orchestrator (a coding agent on a laptop) is asleep. For example: solve, then a review of the patch, then a retry with feedback, then a notification.

Options to compare

  • (a) Declarative continuations. The orchestrator submits a small graph with a bounded retry count, and the control plane advances it as turns finish. It's deterministic, consistent with archetypes §5.1, and the maximum fan-out and budget are known at submission. The LLM authors the graph but never holds spawn power at run time.
  • (b) The re-entrant leaf contract (archetypes §6). A leaf dispatches a child leaf, with parentSessionId lineage, budget propagation, and a child grant minted by the control plane (Z6). It gives the model spawn power, and needs depth and budget caps.
  • Rejected up front: a long-lived "supervisor" LLM leaf holding API credentials. That's the same trust problem as (b) without its structure.

Acceptance

  • A spec in docs/specs/ with a recommendation, the trust analysis under MI1 grants, and a cost-bound argument.
  • No build.

References

Working conventions (for a fresh session)

  • Workspace: git fetch, then create a worktree from rossoctl/main (never local main), under .worktrees/. Populate and build pi-fork (git submodule update --init --recursive && cd pi-fork && npm ci && npm run build), then pnpm install. A worktree without the pi-fork build does not typecheck.
  • Plans: write the plan with superpowers:writing-plans into docs/plans/<date>-<slug>.md. Plans are gitignored and never committed. Write it in chunks, one append per task.
  • Pre-flight table: list every process entrypoint, systemd unit, env example and shell/Go launcher whose boot contract changes, not only TypeScript call sites.
  • Tests: Redis on 6379 must be up. Use each package's own node_modules/.bin/vitest. vitest can exit non-zero with every test green, so grep the log for Errors. Redirect long output to /tmp/kagenti/.... make lint skips untracked files.
  • Commits: git commit -s with Assisted-By: Claude (Anthropic AI) <[email protected]>, never Co-Authored-By.
  • Shared KVM rig: alert the owner before using it, record a manifest of what you install, and verify cleanup.
  • Don't push or open PRs without the owner's go-ahead.

Activity

  1. added
    enhancement
    on Sep 30, 2026
  2. changed the title [-]Claude Code subagents B16: design — durable orchestration (declarative continuations vs re-entrant leaves)[/-] [+]Coding-agent subagents B16: design — durable orchestration (declarative continuations vs re-entrant leaves)[/+] on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions