Skip to content

native: experimental Agent-SDK headless backend (Track B) #153

Description

@itomek

Part of #125. Experimental (Track B) — optional, behind a config flag.

Problem

The JSONL+hook layer is a bridge over PTY sessions. The Agent SDK offers natively structured sessions (canUseTool for permissions, typed message stream). The CodeBackend interface (backend/src/backends/types.ts:85-166) is backend-agnostic — validate that an SDK-based backend can slot in.

Outcome

A HeadlessBackend implementing CodeBackend via @anthropic-ai/claude-agent-sdk: plain-text task:output, canUseTooltask:prompt, resume support — created per-task behind a config flag.

Acceptance criteria

  • Create/drive/stop/resume a task on the SDK backend via test-cli
  • Transcript and permissions arrive structured natively (no JSONL tail, no hooks)
  • resizeTask no-ops cleanly; state lifecycle maps correctly
  • Documented feature-gap comparison vs the PTY backend (slash commands, plan mode, compaction visibility) as a comment on this issue
  • Existing PTY backends untouched; flag off by default

Scope & expectations

  • Where: new backend/src/backends/headless-backend.ts, config-store flag
  • Constraints: SDK is pre-1.0 — pin the version; no changes to CodeBackend interface without discussion

How to verify

CLI — test-cli session transcript on the SDK backend including a structured permission answer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions