Skip to content

v0.13.0

Choose a tag to compare

@github-actions github-actions released this 02 Oct 18:47
· 7 commits to main since this release

Minor Changes

  • 4d53443: Persist context-level notifications immediately instead of deferring them to the next user prompt

    context and emitted ignore notifications (watch log matches, suppressed-match summaries, onKilled: "context") are now sent with triggerTurn: false and no deliverAs, so Pi appends them as displayed custom messages right away — immediately when the agent is idle, and after the running turn's tool results otherwise. They still never wake or steer the agent.

    Requires the Pi extension host that appends custom messages at the turn's tool boundary (pi 0.84.4+, which fixed the mid-run append that made Anthropic requests 400). Peer ranges stay *, so there is no enforced floor: on pi ≤0.84.3 this option shape is unsafe (≤0.84.1 steers the active run; 0.84.2–0.84.3 appends mid-run and 400s). This release is developed and tested against pi 0.87.0, which the devDependencies pin.

    Previously these messages waited for the next user prompt: nothing appeared in the UI and nothing entered model context until the user typed again.

    Also bumps the tested pi toolchain to 0.87.0 (devDependencies only; peer ranges remain *).

  • c3a8e28: Adopt pi's structured tool-output contract for the process tool

    The process tool now declares ProcessToolOutputSchema, a single union schema discriminated by action (pi allows one outputSchema per tool, so per-action schemas are impossible), and every action returns structuredContent alongside the model-facing text. Codemode scripts that call the nested process tool receive structured objects instead of parsing the text preview; model-facing content and the TUI renderers are unchanged.

    Every shape is declared once, schema-first: shared shapes live next to their owners — ProcessInfoSchema and the status/reason tuples in src/types.ts, the log-matcher/notify schemas in the notifications registry, match modes in src/utils/match-line — and each action's details type is derived from its member schema (Static), so the input schema, runtime config, details types, and structured output cannot drift apart. The only hand-kept translation left is pi's TruncationResult (a TS interface, not a schema), mirrored for the output truncation and enforced at its single assignment site.

    The output action's payload additionally carries the raw filtered selection lines behind the preview, bounded by tailLines (≤2000 per stream) and the 5000-line scan window rather than the preview byte limit, mirroring pi's bash contract. Those line arrays live only in structuredContent: pi persists details in the session transcript but never persists structuredContent, so the transcript entry stays bounded while codemode callers get the full selection. truncation still describes only the model-facing preview.

    Also bumps the tested pi toolchain to 1.0.0 (@earendil-works/pi-ai, @earendil-works/pi-coding-agent, @earendil-works/pi-tui; devDependencies only, peer ranges remain * and optional). typebox stays at 1.3.27, the exact version pi 1.0.0 bundles.

Patch Changes

  • 6708947: Fire before_agent_start for turns woken by process notifications on an idle host

    When the host agent is idle, turn notifications are now persisted as displayed custom messages with triggerTurn: false, and the host is woken with a user message instead of a triggerTurn steer. A steer wake on an idle host starts the run through Pi's custom-message path, which never fires before_agent_start (#121), so the woken turn ran without system-prompt additions from that hook — and setups that require them rejected the request outright. The user-message wake goes through pi.prompt(), which fires before_agent_start like a user-typed prompt.

    While a run is active — or before any host lifecycle event has been observed — delivery still steers the active run unchanged. The delivery listener tracks host idleness from the session lifecycle, where agent_settled is the idle signal (ctx.isIdle() is still false in agent_end and turn_end handlers), sends at most one wake until the woken run starts, and re-arms once the host is idle again.