Skip to content

v0.24.3

Choose a tag to compare

@kid7st kid7st released this 05 Oct 06:33
· 141 commits to main since this release
8184d76

pi now builds the system prompt: SYSTEM.md and APPEND_SYSTEM.md replace persona.md. An agent with no default model still opens its conversations. entries() carries an answer's thinking.

This patch release contains breaking changes. Read Upgrading first.

Upgrading from 0.24.2

  1. persona.md is refused (#709). Move its content:
    • to APPEND_SYSTEM.md if it holds standing instructions. This text is added to pi's default prompt, which already says who the agent is. This is the usual case, and what init now scaffolds.
    • to SYSTEM.md if it gives the agent an identity of its own. This text replaces pi's default prompt.
  2. createPiAgentFromDir(...).modelSpec is string | undefined (#708). It is undefined when no default model is set (model option, FASTAGENT_MODEL, or model in fastagent.config.ts). Code that used it as a string no longer typechecks.
  3. Opening an agent without a default model no longer throws missing model (#708). A client that caught that error should handle failed { code: "missing_model" } at invoke instead.

Breaking

Prompt (#709)

  • pi builds the system prompt. piBasePrompt and assembleSystemPrompt are removed. FastAgent hands pi SYSTEM.md (or .pi/SYSTEM.md) as a replacement for pi's default, APPEND_SYSTEM.md (or .pi/APPEND_SYSTEM.md) as an addendum, and AGENTS.md as project context. FastAgent's own sections (deferred tools, and the self-change note on a deployed host) are added as named sections, so they stay in place under a SYSTEM.md. The machine's ~/.pi/agent/SYSTEM.md and APPEND_SYSTEM.md are never used.
  • persona.md is refused, with a message naming SYSTEM.md and APPEND_SYSTEM.md.
  • createPiAgentFromDefinition(dir, { tools }) without read/bash/edit/write is refused unless base or a SYSTEM.md supplies a prompt, because pi's default prompt describes those tools. A blank SYSTEM.md or APPEND_SYSTEM.md is reported and not used. A blank base is refused.
  • LoadedDefinition: persona is removed; systemPrompt?, appendSystemPrompt?, prompts, shadowed, ignored are added. In info --json, persona is replaced by systemPrompt, appendSystemPrompt, prompts, shadowed, ignored.
  • A skill name containing / is refused in the definition. A machine skill with such a name is left out, with a warning.

Models (#708)

  • AgentAssembly.modelSpec, the modelSpec returned by createPiAgentFromDir, and CreatePiAgentFromDefinitionOptions.model are optional.
  • PiBoundaryWiring.defaults.model is optional. resolveSessionSettings returns undefined when a session has no model.

New

  • An agent with no default model still opens (#708, closes #706). This applies to createPiAgentFromDir and createAgentService.
    • sessions.list(), entries(), state() and update() work.
    • A session that records its model runs on it. pi records the model a session starts on, so every session that has run has one.
    • A session with no model of its own fails its invoke with failed { code: MISSING_MODEL_CODE ("missing_model"), retryable: false } and leaves no record behind. compact answers the same code. update({ model }) gives the session a model.
    • The CLI is unchanged: dev, start, invoke, routine run and chat still refuse to start without a default.
  • entries() carries an answer's thinking (#710, closes #707). An assistant entry has thinking?: string, exactly the text its live message_delta { channel: "thinking" } deltas add up to, so reasoning is still readable after a reload or restart. Redacted reasoning is left out, both live and read back. There is one exception: on Bedrock, a reasoning block that streams readable text and then turns redacted shows that text live but not when read back (see docs/design/session-control.md).
  • Where the definition's files are read (#709). Skills come from skills/, then .pi/skills/, then .agents/skills/, then the machine's. Prompt templates come from prompts/, then .pi/prompts/, then the machine's. Extensions are read from extensions/ only. A name defined twice inside the definition is reported. The / menu (commands()) and dispatch read the same merged list.
  • deploy preflight loads the definition, so a refusal in it (a leftover persona.md, a skill name containing /) stops --run before an image is built.
  • info and the startup report show which prompt is in use (pi's default + APPEND_SYSTEM.md, or SYSTEM.md) and the prompt templates.

Docs

The design notes for the agent model and its implementation plan (#703, #705), stage 1 of which is #709.

Full Changelog: v0.24.2...v0.24.3