Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Part of the Coding-agent subagents epic (#378). Item B7, milestone B-M2. Depends on B2 (#387) and B4 (#389).
Goal
Any subagent can stop and ask its owner. The owner answers through one control-plane call from any logged-in client, with no envelope to keep and no session token to juggle. A gate that nobody answers resolves by a deadline.
Current state (verified on main @ 24c6f5e)
- Only converge leaves can gate:
request_approvalis registered only inrealProduceVerdict(harness/src/run-leaf.ts:706,:830). - The paused record carries
gateIdandgate: {summary, proposed_action}(packages/knative-server/src/server.ts:692-696). - Resume means the client resends the whole envelope with an inline
decision(ADR-0020,run-leaf.ts:104) over data-plane/runs, with a session token. An async resume gets the 501. - No deadline (ADR-0016 leaves timeouts to the orchestrator, and here the orchestrator may be a closed laptop).
- P4 microVM tier: WorkspaceIdle=30min deletes a HITL session's workspace mid-session, silently #338: on the P4 tier,
WorkspaceIdle=30mindeletes a parked session's workspace.
Scope
request_approvalavailable to prompt and solve leaves, opt-in per turn, through the shared turn core (executeTurn).- A control-plane
POST /v1/sessions/{id}/decision {gateId, action, feedback}. It checks the pendinggateIdand queues the resume as an async turn built from the stored turn record. - A gate deadline with a default action (
rejectorabort), stored in the turn record and fired without an always-on watcher. For example, enforce it at the next dequeue or through a scheduled sweep; justify the choice against scale-to-zero. - Resolve P4 microVM tier: WorkspaceIdle=30min deletes a HITL session's workspace mid-session, silently #338 for parked sessions: keep the workspace while
paused, or re-converge on resume, and document which.
Acceptance
- A prompt subagent stops, and a decision through the API resumes it asynchronously.
- A stale
gateIdis refused. - The deadline fires the default action.
- A P4 session parked for more than 30 min resumes correctly.
References
- ADR-0016, ADR-0020, human-gate spec
docs/specs/2026-06-28-human-gate-design.md, archetypes §7.6, P4 microVM tier: WorkspaceIdle=30min deletes a HITL session's workspace mid-session, silently #338
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 B7: gates v2 — gates on prompt/solve leaves, decision API, deadlines[/-][+]Coding-agent subagents B7: gates v2 — gates on prompt/solve leaves, decision API, deadlines[/+]fix(control-plane): hold one gate per session across a gated turn's w…
fix(harness): register request_approval for a leaf carrying a decision
fix(harness): a null decision is not a decision
Merge upstream/main into feat/393-gates-v2
fix(control-plane): replay a gated retry, and do not resume a strande…
docs(control-plane): fix the claim-window upgrade note and an orphane…
fix(control-plane): stop claimKey stepping over a live claim mid-create