Skip to content

Chassis Actions: one-shot submit action end-to-end #46

@pechhe

Description

@pechhe

Parent

PRD #45 — Chassis Actions (MVP)

What to build

The complete one-shot submit path for a Chassis Action, end-to-end through every layer.

  • Persist Chassis Action definitions in ~/.pi/agent/chassis/state.json (global per-user), mirroring the caveman state convention. Expose read/write across the Desktop IPC Seam.
  • A pure parseChassisState(json) -> { actions, dropped } that validates on load and drops malformed actions instead of failing (a bad entry must never brick the composer).
  • A new Settings → Actions section that can create a one-shot action with a submit effect (label, showLabel, payload text).
  • A single ChassisActionControl component renders each action as a button in the composer control row, alongside the prebuilt toggles, across the in-thread, new-thread, and pending composer surfaces.
  • Clicking a one-shot submit action fires its fixed payload immediately through the existing composer submit seam (api.submitComposer), leaving any unsent draft untouched, and works whether the session is idle or running (steer).

Schema (MVP, one-shot/submit only here):

{
  "version": 1,
  "actions": [
    { "id": "uuid", "label": "Security audit", "showLabel": true,
      "trigger": "oneShot", "effect": { "type": "submit", "text": "/security-scan" } }
  ]
}

{{input}} templating and sticky/wrap are NOT in this slice. oneShot pairs only with submit.

Acceptance criteria

  • Creating a one-shot/submit action in Settings → Actions persists it to chassis/state.json and it survives an app restart.
  • The action renders as a button in the composer control row on the in-thread, new-thread, and pending surfaces, via a single ChassisActionControl component.
  • Clicking the button sends its payload as a message (verified in the transcript) and leaves the unsent composer draft unchanged.
  • Clicking works when a session is idle and when it is running (steers the running session).
  • A malformed entry in chassis/state.json is dropped on load; the composer still works and other valid actions still render. (Unit test on parseChassisState.)

Blocked by

None - can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentReady for an agent to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions