Skip to content

Plan: production-grade Anthropic compatibility takeover from #107 (canary-first) #114

@joeblack2k

Description

@joeblack2k

Goal

Take over and harden Anthropic support from PR #107 into reviewable, low-risk slices with high Claude API compatibility (including Claude Code behavior).

Hard rollout rule

  • Canary-only until explicit maintainer approval for main/live promotion.
  • No production/main compose switch in this track without written approval in PR/issue.

Scope split (recommended PR sequence)

PR-A: anthropic-core-protocol

  • POST /claude/v1/messages non-stream and stream contract parity
  • Strict Anthropic request/response/error envelope mapping
  • SSE event ordering parity (message_start, content_block_*, message_delta, message_stop, error)
  • Header handling (x-api-key, anthropic-version, anthropic-beta)
  • Contract tests with golden fixtures

PR-B: anthropic-runtime-auth-routing

  • OAuth/API token refresh and retry policy (401 and revoked-token 403)
  • Provider-aware account selection and isolation from OpenAI refresh path
  • Safe defaults for SDK pooling (off by default unless proven safe)
  • Runtime diagnostics toggles (env-gated)
  • Integration tests for auth recovery and account-path correctness

PR-C: anthropic-ops-observability

  • Request logs include provider, actor, model, stop reason, usage breakdown
  • Cost/usage normalization rules documented and tested
  • docs/anthropic-compat-matrix.md with support levels (full/partial/unsupported)
  • docs/anthropic-rollout.md with canary test checklist and rollback

PR-D: anthropic-dashboard-ui (optional but clean)

  • Account import UX for Anthropic credentials
  • UI provider indicators/badges separated from backend protocol work
  • Frontend tests scoped to Anthropic UI changes

Compatibility target matrix

  • Must: /claude/v1/messages API compatibility (non-stream + stream)
  • Should: /claude/v1/models, /claude/v1/messages/count_tokens
  • Nice-to-have: beta feature passthrough where safe

Validation gates (each PR)

  • Ruff/ty/pytest green
  • Frontend checks green (if touched)
  • No regression for existing /v1/* OpenAI-compatible routes
  • Canary smoke tests attached in PR body with HTTP codes and sample payload traces

Proposed ownership model for multi-agent work

  • One owner per PR slice, plus one reviewer from another slice
  • Freeze force-push after first review unless branch cleanup is requested
  • Keep PR bodies in format: Summary / Why / Validation / Risks / Rollback

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions