Skip to content

Anthropic Subscription Adapter #106

@davidste

Description

@davidste

Summary

Implement the Anthropic subscription adapter path on top of the shared subscription auth foundation.

This issue covers Anthropic-specific runtime behavior when Loomkin uses subscription OAuth credentials instead of standard API keys.

Depends On

Scope

Adapter behavior

  • Add Anthropic subscription auth mode selection at runtime.
  • Route requests through the correct Anthropic endpoint path for this mode.
  • Apply Anthropic subscription identity/header behavior required by this auth mode.
  • Keep standard Anthropic API-key flow as fallback.

Request shaping

  • Implement any required tool-name/system-context transformations for compatibility in subscription mode.
  • Ensure tool-call and streaming behavior remain compatible with Loomkin’s current agent loop.

Risk controls

  • Explicit user opt-in before enabling Anthropic subscription mode.
  • Clear warning copy about policy/risk tradeoffs.
  • Safe fallback behavior when subscription auth is invalid/expired/revoked.

Observability

  • Add adapter-level telemetry for mode selection, auth failures, and fallback activation.
  • Keep secrets redacted across all error/log surfaces.

Out of Scope

  • Shared OAuth lifecycle implementation.
  • Codex/Gemini adapter behavior.
  • Coding-plan provider integrations.

Acceptance Criteria

  • Anthropic subscription mode works end-to-end with valid auth.
  • Required Anthropic subscription headers/identity behavior are applied correctly.
  • Streaming and tool-call paths work in subscription mode.
  • Invalid/expired auth triggers deterministic fallback and user-visible status.
  • API-key Anthropic flow remains backward compatible.
  • Integration tests cover happy path, expired auth, revoked auth, and fallback path.

Implementation Touchpoints

  • lib/loomkin/agent_loop.ex
  • lib/loomkin/session/architect.ex
  • lib/loomkin/teams/agent.ex
  • lib/loomkin/models.ex
  • lib/loomkin_web/live/model_selector_component.ex

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions