Skip to content

feat(llm): Claude Code subscription backend + AWS provider isolation - #47

Merged
AhmadHammad21 merged 3 commits into
mainfrom
feat/add_claude_code
May 23, 2026
Merged

AhmadHammad21 merged 3 commits into
mainfrom
feat/add_claude_code

Conversation

@AhmadHammad21

@AhmadHammad21 AhmadHammad21 commented May 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Claude Code as a zero-config LLM backend. If the claude CLI is installed and logged in, OpenDevOps reuses its subscription login as the Anthropic backend — no API key, no .env changes. LiteLLM (≥1.83) handles the sk-ant-oat OAuth token (Bearer + OAuth beta header), and system prompts are shaped with the required Claude Code identity block so subscription inference is accepted.
  • Pluggable LLM detector registry (src/agent/llm/): a backend.py resolver + detectors/ registry. Adding a provider = drop a file implementing LlmDetector, append to ALL_DETECTORS.
  • Active backend surfaced in the UI — the init wizard (Step 2) and Settings → Environment show a card with the detected provider/model.
  • AWS isolated behind a CloudProvider protocol (src/providers/): AWS tools, context collection, permission checks, poller, and event ingestion moved into providers/aws/. New CLOUD_PROVIDER setting (aws|azure|gcp); azure/gcp are stubs. Agent core (LangGraph/LLM/skills) stays cloud-agnostic.

Backend precedence

Auto-detection only activates when no other provider is explicitly configured. To use Claude Code, leave LLM_MODEL, OPENROUTER_API_KEY, ANTHROPIC_API_KEY, and LLM_API_BASE unset. Docs and .env.example updated to make this clear.

Notes

  • AWS tool files moved with git mv (history preserved); tool count unchanged (26).
  • One deliberate AWS coupling kept: the init wizard's event-infra setup/teardown imports providers.aws.event_infra directly (SQS/EventBridge provisioning is AWS-specific; generalizing the wizard is future work).
  • Follow-up for more provider detectors (Gemini, Codex): feat: add LLM provider detectors for other CLIs (Gemini, Codex, …) #46

Test plan

  • Chat works with Claude Code active (subscription auth); Settings shows "Claude Code (auto-detected)"
  • Chat works with OpenRouter (set LLM_MODEL + OPENROUTER_API_KEY) — precedence over Claude Code
  • AWS tool calls run (e.g. "list Lambda functions") — confirms providers/aws dispatch
  • uv run dev boots clean; poller/consumer start via the active provider
  • uv run pytest green (198 passed, 4 skipped locally)

…providers

- Auto-detect the Claude Code CLI and use its subscription OAuth login as the
  Anthropic LLM backend (no API key needed). LiteLLM handles sk-ant-oat tokens;
  system prompts are shaped with the required Claude Code identity block.
- Add agent/llm/ package: backend resolver + pluggable detector registry.
- Surface the active LLM backend in the init wizard and Settings.
- Restructure cloud-specific code under providers/ behind a CloudProvider
  protocol; move AWS tools/context/permissions/poller/events into providers/aws/.
- Add CLOUD_PROVIDER setting (aws|azure|gcp); azure/gcp are stubs.
…_KEY unset

Auto-detection only activates when no other provider is explicitly configured.
Restructure .env.example to present Claude Code as the zero-config default.
…solution

Covers token detection, model-slot mapping, env-key vs subscription precedence,
expired-token flag, and the full backend resolution ladder (including the
OpenRouter-blocks-Claude-Code case). Fully mocked — no ~/.claude access, no
network, no API spend.
@AhmadHammad21
AhmadHammad21 merged commit 67ac3db into main May 23, 2026
2 checks passed
@AhmadHammad21
AhmadHammad21 deleted the feat/add_claude_code branch May 23, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant