Expand description
Client interceptor for the ask verb on an opencode target (x-51f6), plus
the headless one-shot dispatch (dispatch_opencode_once).
opencode is hosted two ways: an interactive PTY pane (the ask resume path,
which stays refused - no stateful client-side resume in v1) and a headless
one-shot opencode run --dangerously-skip-permissions "<prompt>" (this module’s dispatch_opencode_once,
substrate headless). The one-shot is STATELESS like agy: plain-text stdout,
no session id minted here, no registry row, no --continue resume from this
path. It reuses the shared subprocess_ask primitives (stdin /dev/null,
watchdog, process-group SIGINT) rather than duplicating agy’s error taxonomy.
ask (resume-by-name) still refuses: it names the real limitation instead of
falling through to bin/client.rs’s unresolvable_ask_exit “provider is
required for new agent” text (wrong - the agent exists - and a dead end).
Mirrors crate::agy_ask::maybe_run_agy_ask’s shape.
Structs§
- AskOutcome
- Stdout/stderr/exit triple returned to the client (mirror of the sibling
provider
AskOutcomes; each module owns its own nominal type).
Functions§
- dispatch_
opencode_ once - Orchestrate one opencode
spawn --substrate headless: validate, fail-closed registry + name-collision check, then runopencode runand return the reply. STATELESS by design - opencode’s own--session/--continueresume is a pane/interactive concern, not this one-shot;namelabels the log + events. - maybe_
run_ opencode_ ask - Returns
Nonefor a non-opencode target (fall through to the next provider’s ask hook), orSome(2)after printing the refusal.