Skip to content

Verify per-harness send-while-running semantics (truth table) #180

Closed

Description

@omridevk

Question

Per harness (claude, codex, gemini, opencode, pi): when a headless per-turn run is streaming and another send arrives, what does the platform NATIVELY do? Does the harness adapter (packages/harness) expose any mid-run input channel in headless mode, or is each turn one process? Evidence from adapter source + packages/harness/docs/cli-behaviors.md — no guessing. Output: filled truth table (per harness: native behavior → UI mapping: steer gesture vs native injection). Decides the composer's send-while-running surface.

Activity

  1. omridevk commented on Aug 2, 2026

    @omridevk
    ContributorAuthor

    Resolved (research, 2026-08-03; key citations spot-verified by orchestrator).

    Harness Process model per headless turn Native mid-run input? Interrupt/stop UI mapping
    claude One claude -p --output-format stream-json ... --resume <id> process per turn; stdin written once then closed (ai-sandbox runner.js:19-20) Platform YES via Agent SDK streaming-input query() + interrupt() control requests (sdk.d.ts:2242-2270) — used only for command probing (harness/src/claude/sdk.ts), NOT the chat path abort → SIGKILL process tree, driven by DB 'stopping' (run.ts:144-146) stop-then-send
    codex One codex exec --experimental-json ... resume <id> process per turn; same write-once stdin UNKNOWN (no streaming-input flag used) same kill path stop-then-send
    gemini-cli Fresh gemini --acp process per turn; one session/prompt JSON-RPC, process killed after ACP models only session/cancel mid-turn (acp.d.ts:442-452); concurrent second prompt UNKNOWN ACP session/cancel stop-then-send
    opencode Per-turn opencode HTTP server + one session.prompt() call, disposed after Platform PLAUSIBLE (session.prompt/session.abort are independent HTTP calls on a persistent server) — our adapter never uses it; live queue/reject behavior UNKNOWN session.abort() HTTP stop-then-send
    pi Headless chat not implemented — stub yields RUN_ERROR (_shared/stub.ts:11-18) N/A N/A N/A

    Design consequence: TODAY, every headless turn is one process with stdin closed — no harness adapter has a mid-run input channel. So the composer's send-while-running surface for widget-driven runs = STEER (stop current run, send new message), uniform across harnesses, honestly surfaced. No queue, nothing buffered.

    Upgrade path (fog, not this rewrite): claude Agent SDK streaming-input mode and opencode's persistent server both offer real native mid-run channels; adopting either is a per-adapter upgrade that would turn steer into native injection there. UNKNOWNs (codex mid-run flags, gemini concurrent session/prompt, opencode live queue behavior, claude -p --input-format stream-json long-lived stdin) need live CLI experiments — none block the rewrite since the uniform steer mapping doesn't depend on them.

  2. omridevk commented on Aug 2, 2026

    @omridevk
    ContributorAuthor

    Version addendum (user challenge, verified against npm): installed = ai 0.41.0 / adapters 0.2.2 / sandbox 0.2.3 / client 0.22.0; latest = ai 0.42.0 / adapters 0.2.3 / sandbox 0.2.4 / client 0.22.1. The ENTIRE delta is one minor change: tool-call fan-out caps (maxToolCalls, maxToolCallsPerTurn, TanStack/ai#965); every adapter/sandbox/client bump is a dependency-only patch. No new send, mid-run input, or adapter behavior anywhere. Truth table holds for latest. (Upgrading to 0.42 during the rewrite is cheap and worth doing anyway.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions