You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(runner): dispatch a run.command extension command headlessly (#189)
The runner half of issue #189 Gap 2 (the trigger field itself follows as
the producer half). A trigger will be able to name a registered pi
extension command instead of a flow; this PR ships the dispatch protocol
the pinned artifact already supports.
The prompt for a command job is rebuilt from PI_COMMAND as /<command>,
never read from prompt.md: pi's dispatch grammar fires only when the
ENTIRE text starts with a slash, parses the name to the first space and
hands everything after it to the handler verbatim, so there is no such
thing as a command line at the top of a larger prompt, and one
in-container authority means a worker bug cannot make the classification
misread a flow job. prompt.md stays the byte-identical human record.
Before prompting, the runner verifies the name via
session.extensionRunner.getCommand() and refuses an unregistered one as
command-unregistered (exit 2, pre-spend): an unregistered /name is not an
error to pi, it falls through template expansion into a paid model call,
or into a same-named prompt template if one is staged. A handler throw is
SWALLOWED by pi (prompt() resolves cleanly) and surfaces only on the
public extensionRunner.onError channel; the runner subscribes and
classifies it command-error, exit 1 retryable by explicit choice: pi
hands us a message string, transient-vs-deterministic is undecidable, and
the accepted cost (a deterministic extension bug retries until attempts
run out) is recorded on the new DES entry. A clean headless return is
command-completed, exit 0; before that reason existed the same shape was
the retryable no-terminal-message, and the queue re-billed a success. A
handler that drove the model keeps its terminal's ordinary verdict, and
budget aborts keep first position.
The image's capabilities label gains commands, with a verify-image.sh
case asserting the claim against the baked runner source; the worker-side
preflight gate lands with the producer half. A keyless real-session
contract test pins all four dispatch facts against the pinned artifact.
Specs: INT-RUNNER-EXIT-CODE-PROTOCOL AMENDED (three reasons under
existing codes, never a new outcome), INT-CONTAINER-JOB-INPUTS AMENDED
(PI_COMMAND), NEW DES-COMMAND-ENTRY-POINT. UNCHANGED, checked:
INT-TRIGGERS-FILE-CONTRACT, DES-FLOW-RESOLUTION-TWO-ADVISORY-LAYERS,
DES-PER-TRIGGER-JOB-IMAGE, DES-TRIGGER-INSTRUCTION-IN-THE-ENVELOPE.
Signed-off-by: Rob Boerman <robboerman@live.nl>
0 commit comments