fix(ai): migrate off retired Claude model (restores AI endpoints) - #1
Conversation
Add committed example config and gitignore machine-local CE config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude-sonnet-4-20250514 retired 2026-06-15, so /api/chat, /api/bid-review, and /api/onboarding were returning 404 on every request. Centralize model IDs in lib/ai/models.ts and point each route at a current model: chat + onboarding -> claude-sonnet-4-6, bid-review -> claude-opus-4-8. Pure model-ID swap; no breaking-parameter edits needed (no prefill, sampling params, or budget_tokens in any route). Implements U1 of docs/plans/2026-06-17-001-feat-maximize-ironforge-plan.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comprehensive, phased improvement plan (foundation -> growth -> polish -> breadth). U1 (this branch) ships the emergency AI model fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughIntroduces a ChangesAI Model ID Centralization
IronForge Roadmap & Tooling Config
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/plans/2026-06-17-001-feat-maximize-ironforge-plan.md`:
- Around line 126-139: The fenced code block containing the ironforge directory
tree structure is missing a language tag after the opening triple backticks,
which violates MD040 linting rules. Add a language tag such as `text` or
`plaintext` immediately after the opening backticks (e.g., ```text instead of
```) to mark the fence block and ensure the tree renders cleanly without linting
errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5d41d5b3-327d-47e6-99d6-d234e650297a
📒 Files selected for processing (7)
.compound-engineering/config.local.example.yaml.gitignoreapp/api/bid-review/route.tsapp/api/chat/route.tsapp/api/onboarding/route.tsdocs/plans/2026-06-17-001-feat-maximize-ironforge-plan.mdlib/ai/models.ts
| ``` | ||
| ironforge/ | ||
| ├── lib/ | ||
| │ ├── db/ # Drizzle schema + client (U7) | ||
| │ ├── auth/ # Auth.js config, entitlements (U8, U10) | ||
| │ ├── validation/ # shared isValidX guards hoisted from lib/store/* (U9) | ||
| │ └── store/persistence.ts # Local | Server | Hybrid facade (U9) | ||
| ├── app/api/ | ||
| │ ├── state/ # profile, progress, chat, store, migrate, export, delete (U9) | ||
| │ └── billing/ # checkout, portal, webhook (U10) | ||
| ├── tests/ # Vitest unit/integration; Playwright e2e (U2) | ||
| ├── auth.ts # Auth.js v5 entrypoint (U8) | ||
| └── .github/workflows/ci.yml # lint + typecheck + test gate (U2) | ||
| ``` |
There was a problem hiding this comment.
Add a language tag to the tree fence.
The unlabeled fenced block triggers MD040 and can fail the docs lint gate. Mark it as text (or plaintext) so the tree renders cleanly.
Suggested fix
-```
+```text
ironforge/
├── lib/
│ ├── db/ # Drizzle schema + client (U7)
@@
└── .github/workflows/ci.yml # lint + typecheck + test gate (U2)
-```
+```📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| ironforge/ | |
| ├── lib/ | |
| │ ├── db/ # Drizzle schema + client (U7) | |
| │ ├── auth/ # Auth.js config, entitlements (U8, U10) | |
| │ ├── validation/ # shared isValidX guards hoisted from lib/store/* (U9) | |
| │ └── store/persistence.ts # Local | Server | Hybrid facade (U9) | |
| ├── app/api/ | |
| │ ├── state/ # profile, progress, chat, store, migrate, export, delete (U9) | |
| │ └── billing/ # checkout, portal, webhook (U10) | |
| ├── tests/ # Vitest unit/integration; Playwright e2e (U2) | |
| ├── auth.ts # Auth.js v5 entrypoint (U8) | |
| └── .github/workflows/ci.yml # lint + typecheck + test gate (U2) | |
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 126-126: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/plans/2026-06-17-001-feat-maximize-ironforge-plan.md` around lines 126 -
139, The fenced code block containing the ironforge directory tree structure is
missing a language tag after the opening triple backticks, which violates MD040
linting rules. Add a language tag such as `text` or `plaintext` immediately
after the opening backticks (e.g., ```text instead of ```) to mark the fence
block and ensure the tree renders cleanly without linting errors.
Source: Linters/SAST tools
The CLA Assistant workflow requires one-time infra (a PERSONAL_ACCESS_TOKEN
secret + a private signatures repo) that was never set up, so it errored on
every PR ("Please add a personal access token..."). A CLA protects against
external contributors' IP claims; gating the owner's own AI-assisted PRs is
premature. Remove it for now — re-add properly if/when outside contributors
arrive.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What & why
claude-sonnet-4-20250514retired on 2026-06-15, so all three AI endpoints —/api/chat,/api/bid-review,/api/onboarding— have been returning 404 on every request since then. This restores them.Changes
lib/ai/models.tscentralizes the model IDs so the next migration is a one-line change.claude-sonnet-4-6(fast/cheap mentor)claude-opus-4-8(deeper contract analysis, low volume)budget_tokensto remove, and streaming is unchanged, so no client changes needed.Verification
npx tsc --noEmit,npm run lint,npm run buildall pass..env.localhas noANTHROPIC_API_KEY, so the 404→200 confirmation must happen in the deployed environment. Do not consider the outage resolved until one real AI request succeeds in prod.Context
Implements U1 of
docs/plans/2026-06-17-001-feat-maximize-ironforge-plan.md(the improvement roadmap, included in this branch). U1 ships independently as the emergency fix; the rest of the roadmap is separate work.🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Documentation
CI / Maintenance