Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
enhancementNew feature or request
Milestone
Description
Part of the Coding-agent subagents epic (#378). Item A0: it decides whether Track A goes ahead. It builds on #370's VM, and runs the same probe on the #426 K8s stack.
Goal
Prove on the #370 VM, and on the #426 K8s stack (deploy/k8s, Kind or OCP), that a synchronous POST /runs {kind:"prompt", configRef} keeps running after its client disconnects, and that its result can be read later with a fresh session token. Record a go/no-go for Track A's mechanism: a coding-agent subagent is a prompt leaf fired as a sync /runs from a detached local process.
Current state (verified on main @ 24c6f5e)
- Disconnect handling:
/turnwiresres.on('close')to an abort (packages/knative-server/src/server.ts:293-302), somocactl runcan't detach./runsdoesn't.handleRunLeafParsedrunsrunLeafto the end, thenwriteResult, then responds (server.ts:624-667).
- Result records:
- Under authentication
tenantis refused (server.ts:834), so the key is the plain session id. It's written at:663and read by/runs/statusat:677. - The TTL is 24 h (
LEAF_RESULT_TTL_SECONDS,server.ts:49). - A missing record reads as
queued(:678-680).
- Under authentication
- Authentication:
/runsauthenticates like/turn(MI1 R7). It needs a session token that names the session: 5 min (packages/control-plane/src/main.ts:81), minted withPOST /v1/sessions/{id}/token, and checked when the request starts.- Async is refused with
501 async_runs_unavailable(server.ts:838-850).
- Bundle:
configRefin a/runsbody is accepted under authentication today. MI1 S3'sconfigRef_forbiddenisn't built.- Only prompt leaves read it (
harness/src/run-leaf.ts:468, insiderunPromptLeaf,:361).
- Sandbox routing on P6:
- Prompt leaves lease through
selectPoolSandboxand the relay (ADR-0028 amendment;deploy/vm/env/supervisor.env.example:13-22). The pool cap is 4 (:22). - On saturation, sync
/runswaits a bounded time and then returns 503 without writing a record (server.ts:638-658).
- Prompt leaves lease through
- P6 admission counts only
/turn(packages/knative-server/src/worker.ts:37,:117), so a leaf on/runsisn't tracked as in flight.
Scope
On the VM (or the compose trial), and again on the #426 K8s stack, with one logged-in subject:
- Create a session and a session token. POST a 3–5 minute research prompt leaf with a promoted
configRef. Kill the client after 10 s. - Poll
/runs/status?sessionId=with a fresh session token untilresponded. Confirm from the answer, and the worker logs if needed, that a bundle skill was used and thatcurl/gitran in the sandbox. - Run 6 leaves at once, above cap 4, and record what saturation looks like (a 503 before start, or a wait).
- Restart
sh-supervisorwhile a leaf is running and record the outcome. Expected: the leaf is lost and status staysqueued. On K8s, the equivalent is deleting themoca-supervisorpod. - Optional: repeat steps 1–2 on the P4 tier if VM demo D: wire the P4 microVM worker into P6 and run its first real harness turn #369 has landed.
Acceptance
- A findings note in
docs/notes/with the go/no-go and evidence for each behavior above, per substrate. The go/no-go can differ per substrate only with a stated reason. - If it's a no-go, the note names the fallback. For example, keep a laptop-side connection, which turns the demo into "quit Claude Code" rather than "close the lid".
Out of scope
- Code changes (A1 pins the behavior; B4 replaces it).
Depends on
- VM demo A: run the MU1 control plane on deploy/vm (systemd unit, generated secrets) #366 (closed) and VM demo C: per-user inference credentials and a curl/git research turn in the P6 container sandbox #368 (PR feat: per-user inference credential headers and sandbox research tooling (#368 phase 1) #372 merged). The VM probe uses the shared KVM rig, so alert the owner first; the K8s probe can run on a local kind cluster (
deploy/k8s/setup.sh --target kind) with no rig.
References
- ADR-0028 (prompt leaves), ADR-0020 (inline envelope)
- MI1 spec
docs/specs/2026-09-28-moca-multi-user-isolation-design.md: R7, §6.5, §7.2 - Epic: VM demo slice — P6 + P4 on one VM, multi-user mocactl login, sandbox research turns #370, Ambiguity between "run" and "session" — clarify or eliminate the term #279
Working conventions (for a fresh session)
- Workspace:
git fetch, then create a worktree fromrossoctl/main(never localmain), under.worktrees/. Populate and buildpi-fork(git submodule update --init --recursive && cd pi-fork && npm ci && npm run build), thenpnpm install. A worktree without the pi-fork build does not typecheck. - Plans: write the plan with
superpowers:writing-plansintodocs/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 forErrors. Redirect long output to/tmp/kagenti/....make lintskips untracked files. - Commits:
git commit -swithAssisted-By: Claude (Anthropic AI) <[email protected]>, neverCo-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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
[-]Claude Code subagents A0: spike — detached sync /runs prompt leaves on the #370 VM[/-][+]Claude Code subagents A0: spike — detached sync /runs prompt leaves on the #370 VM and the #426 K8s stack[/+][-]Claude Code subagents A0: spike — detached sync /runs prompt leaves on the #370 VM and the #426 K8s stack[/-][+]Coding-agent subagents A0: spike — detached sync /runs prompt leaves on the #370 VM and the #426 K8s stack[/+]pdettori commentedon Nov 16, 2026
Closing as superseded.
mocactl spawnruns a detached syncPOST /v1/runsleaf (feat: mocactl subagent commands - spawn, subagents, get #496). A chained diagnose→fix flow was exercised end to end on main (see Coding-agent subagents A2: mocactl subagent commands (spawn, subagents, get, watch, approve, follow-up) over today's API #381, 2026-10-26)./runs(feat(knative-server): async leaf worker on P6 (#389 M1) #717), the async branch answers 400 rather than 501, and the run-lease reaper changes step 4's expected outcome.Step 3 (saturation) and step 4 (restart) belong as one line each in #380's contract text rather than in a separate spike.