Skip to content

feat: Amazon Bedrock provider + runtime model toggle dashboard - #2

Open
kejiali wants to merge 3 commits into
cgaeking:mainfrom
kejiali:feature/bedrock-provider
Open

feat: Amazon Bedrock provider + runtime model toggle dashboard#2
kejiali wants to merge 3 commits into
cgaeking:mainfrom
kejiali:feature/bedrock-provider

Conversation

@kejiali

@kejiali kejiali commented Mar 6, 2026

Copy link
Copy Markdown

Changes

Bedrock Provider (original)

  • Direct AWS Bedrock provider using SDK ConverseStream API
  • Model toggle dashboard at /dashboard

Bug Fixes & Improvements (new)

  • Stop reason mapping: Bedrock/Anthropic stop reasons now correctly map to OpenAI format (max_tokenslength, tool_usetool_calls, stop_sequencestop). Fixes OpenClaw Unhandled stop reason: max_tokens errors.
  • Timestamped logs: All [ClawRouter] console output now prefixed with [YYYY-MM-DD HH:MM:SS] via shared clog/cerr helpers in src/log.ts.
  • COMPLEX tier → Opus primary: COMPLEX was identical to MEDIUM (both Sonnet). Now COMPLEX uses Opus as primary with Sonnet fallback, for both standard and agentic tiers.
  • Remove savings metric: Removed misleading "saved X%" from log output (was comparing against direct Anthropic Opus pricing, not relevant for Bedrock users).

kejiali and others added 3 commits March 6, 2026 08:58
- DisabledModels module: in-memory Set persisted to ~/.openclaw/clawrouter/disabled-models.json
- GET /api/models — returns all tier models with enabled state and tier assignments
- POST /api/models/toggle — toggles a model on/off and persists to disk
- GET /dashboard — self-contained dark-theme UI with provider grouping, toggle switches, tier badges, warning banner, and 5s auto-refresh
- proxyRequest filters disabled models from modelsToTry; returns 503 if all models in a tier are disabled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Amazon Bedrock as direct provider (SDK-based, not HTTP)
- Add /dashboard UI for toggling models on/off at runtime
- Add /api/models and /api/models/toggle endpoints
- Persist disabled models to ~/.openclaw/clawrouter/disabled-models.json
- Filter disabled models from routing fallback chains
- Fix: missing space in checkbox data-model attribute
- Fix: use async body reading for toggle endpoint
…emove savings metric

- Map Bedrock/Anthropic stop reasons to OpenAI format (max_tokens→length, tool_use→tool_calls)
- Add timestamps to all console log output via shared clog/cerr helpers
- COMPLEX tier now routes to Opus as primary (was identical to MEDIUM/Sonnet)
- Remove misleading savings percentage from log output
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