Skip to content

Gemini CLI provider adapter: invocation, event mapping, usage, blocker detection #72

Description

@Ryan-Atkinson87

Implement ProviderAdapter for the Gemini CLI behind the existing interface (#16). Resolves, for Gemini, the §15 open item deferred until a second provider was wanted: per-provider event mapping, usage extraction, and blocker detection.

Spec §3.1 (adapter interface), §3.2 (Gemini row — headless -p, --output-format json, large context, read-only Plan Mode), §3.3 (build order + MVP note).

Acceptance criteria

  • run_session(...) invokes the Gemini CLI headless with -p and --output-format json (§3.2).
  • Event mapping: Gemini JSON stream → NormalisedEvent (reasoning / tool-call / tool-result / output) so the UI streams live progress identically to Claude (§3.1).
  • Usage extraction: tokens in/out, cost, model, duration → UsageReport (§3.1).
  • Blocker detection: maps Gemini output to outcome: completed | blocked | error (§3.3 note).
  • artifacts derived from git, not provider self-report (§3.1).
  • No Gemini-specific calls leak outside this adapter — orchestration talks only to ProviderAdapter (§3.3).
  • Uses the resolved per-role model string passed in; no model mapping inside the adapter (§3.1).
  • Every CLI invocation has explicit success and failure paths — no silent failure.
  • Unit tests with recorded Gemini JSON fixtures cover each event type, usage extraction, and the blocked/error outcomes.

Depends on: #16, #9, #4

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions