Skip to content

backends: parse Claude SDK transcript entries instead of reading them through any #1370

Open

Description

@schlessera

Part of #1344.

Context

History reads SDK transcript JSON with 12 anys (packages/ui-backend-claude/src/history.ts). The contract test drives a scripted query cast as unknown as typeof query (packages/ui-backend-claude/tests/backend-contract.test.ts:31-50), so an upstream transcript shape change would pass tests and fail silently in production.

Scope

  • A zod schema for the transcript entry kinds history consumes, tolerant of unknown extra fields.
  • Unknown entry kinds are skipped with a diagnostic, not crashed on.

Out of scope

  • Upgrading the SDK.

Acceptance criteria

  • No any in history.ts.
  • A test with a renamed field in a fixture transcript produces the diagnostic, failing before the change.

Verification

bun run test packages/ui-backend-claude

Contract impact

None.

Activity

  1. added
    type: fix
    area: backends
    priority: p3
    agent-ready
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: backendspriority: p3type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions