Skip to content

Multi-provider stream adapters via a per-agent format field #11

Description

@Beroni

Description

Make non-Claude agent CLIs first-class citizens of the live experience: a per-agent format: field selecting a stream adapter, instead of the current implicit Claude-only detection.

Motivation

The execution contract is already provider-agnostic — any CLI that reads the prompt on stdin and writes markdown to stdout works, and an agent can override command/args (so codex exec - or gemini -p run today). But everything rich comes from internal/agent/stream.go, which only parses claude -p --output-format stream-json (detected by isStreamJSON(args)). With any other provider the live log is raw stdout with no per-subagent panes, and token usage and quota never show up.

Proposed Solution

  • New optional field on the agent block and on each AgentDef: format: claude-stream | codex-json | plain (default: today's behavior — claude-stream when the args ask for stream-json, plain otherwise).
  • Turn the current streamParser into an interface producing the existing internal events (log line with agent attribution, usage delta, limits); stream.go becomes the Claude adapter.
  • Add a codex-json adapter for codex exec --json (JSONL) as the second implementation proving the interface; a Gemini CLI adapter can follow the same shape.
  • Usage from non-Claude adapters feeds the same counters, so per-step and total token reporting (and Report estimated cost in dollars alongside token usage #3's dollar costs) work across providers.

Acceptance Criteria

  • format: is accepted per agent and inherited from the agent block
  • Existing configs behave identically without the field
  • A codex-json agent shows a readable live log and token usage
  • README documents a working recipe per supported provider

Related: #3 (dollar cost reporting — the price table should be keyed by provider/model from day one), #12, #13.

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions