• feat(sessions): get_persona_state client + persona error taxonomy (v0.12.0)

    vh released this 2026-05-25 18:55:12 -07:00 | 243 commits to main since this release

    Adds the read-side half of Worldtree #204's persona-state observability
    surface. Pairs with v0.11.0's AffectUpdate SSE event — together they
    let a consumer hydrate a persona pane on session-open (this GET) and
    keep it live as turns fire (the SSE event).

    Public surface:

    • get_persona_state(client, agent_id) -> dict[str, Any] — GET
      /agents/{agent_id}/persona_state, returns the same snapshot dict
      shape as AffectUpdate.snapshot
    • New exception types mapped from the spec's documented 4xx error_codes:
      • PersonaNotConfigured (404 persona_not_configured) — agent has
        no persona surface (domari, muninn, all Tier 3 in Phase 2.0)
      • AgentNotAvailable (404 agent_not_available) — unknown agent_id
      • AuthScopeDenied (403 auth_scope_denied) — key lacks the
        requested scope (persona.read here; reusable for future scoped
        endpoints)
    • Other non-2xx falls through to the existing SessionApiFailed
      precedent so novel failure modes aren't silently absorbed

    Tests: 6 new cases covering happy snapshot return, each typed 4xx
    sub-code, unknown 404 fall-through, and 5xx SessionApiFailed parity.

    Not yet consumed: TUI persona surface (Persona TabPane / sticky
    header line). UX shape pending operator direction — step 3.

    Downloads