Skip to content

feat(ironclaw): Anthropic OAuth auth and global chat mode - #25

Merged
ALuhning merged 2 commits into
masterfrom
feat/ironclaw-anthropic-oauth
Mar 8, 2026
Merged

ALuhning merged 2 commits into
masterfrom
feat/ironclaw-anthropic-oauth

Conversation

@jim-agent

Copy link
Copy Markdown
Collaborator

Summary

  • Anthropic OAuth: Build ironclaw from source (main branch) to include nearai/ironclaw#384 — uses subscription OAuth token instead of API key billing
  • Global chat mode: Ironclaw is now usable anywhere in the app, not just inside problem sets. Global conversations are scoped per-user via DID-derived thread IDs
  • Docker config: ANTHROPIC_OAUTH_TOKEN env var added to both dev and prod compose files

Changes

Area Files What
Infra ironclaw/Dockerfile Multi-stage Rust build from source (replaces release binary download)
Infra docker-compose*.yml, .env.example Add ANTHROPIC_OAUTH_TOKEN env var
Backend ironclaw-router.ts Add POST /global/message, GET /global/history routes
Backend ironclaw-service.ts handleGlobalMessage, getGlobalHistory, getGlobalChannel — per-user scoped
Frontend ironclaw-service.ts Support null problemSetId in sendMessage/getHistory
Frontend useIronclaw.ts WebSocket + messaging in both global and PS modes
Frontend IronclawDrawer.tsx Always show input; mode indicator in global mode; hide @mentions
Frontend IronclawContext.tsx Pass isGlobalMode instead of noProblemSet

Setup

  1. Generate OAuth token: claude setup-token (headless) or claude login (browser)
  2. Add ANTHROPIC_OAUTH_TOKEN=sk-ant-oat01-... to .env (local) and .env.prod (server)
  3. Remove ANTHROPIC_API_KEY (OAuth takes lower priority — if API key exists, it wins)

Test plan

  • Build ironclaw container from source: docker compose build ironclaw
  • Verify OAuth auth works: check ironclaw logs for Using Anthropic OAuth API
  • Test global chat (no problem set selected): send message, verify response
  • Test PS-scoped chat: select problem set, verify @mention specialists still work
  • Verify separate users get separate global conversations

🤖 Generated with Claude Code

jim-agent and others added 2 commits March 8, 2026 09:45
The validation runner was constructing an incomplete BastionState missing
required fields (objectives, taskType, invocationCount, etc.) and passing
plain {role, content} objects instead of LangChain BaseMessage instances.
This caused buildAgentSystemPrompt to throw on state.objectives.join(),
silently falling back to [Simulated] responses that score near-zero on
every metric — triggering circuit breaker disables for ALL agents.

The bug was exposed by the fixture-loading fallback (cb0a447) which made
validation tests actually run for the first time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch ironclaw from API key billing to Anthropic OAuth (subscription-based)
by building from source to include PR nearai/ironclaw#384. Add global chat
mode so ironclaw is usable anywhere in the app, not just inside problem sets.

- Dockerfile: multi-stage build from source (main branch) for OAuth support
- docker-compose: add ANTHROPIC_OAUTH_TOKEN env var (dev + prod)
- Backend: add POST /global/message and GET /global/history routes
  scoped per-user via DID-derived thread IDs
- Frontend: enable chat input in global mode with mode indicator,
  dynamic WebSocket channel subscription from API response
- .env.example: document ironclaw config section

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jim-agent
jim-agent requested a review from ALuhning March 8, 2026 14:32
@ALuhning
ALuhning merged commit b53e64c into master Mar 8, 2026
2 checks passed
@ALuhning
ALuhning deleted the feat/ironclaw-anthropic-oauth branch March 8, 2026 14:33
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.

2 participants