Skip to content

fix(ai): migrate off retired Claude model (restores AI endpoints) - #1

Merged
Steel-tech merged 4 commits into
mainfrom
fix/ai-model-retired
Jun 18, 2026
Merged

fix(ai): migrate off retired Claude model (restores AI endpoints)#1
Steel-tech merged 4 commits into
mainfrom
fix/ai-model-retired

Conversation

@Steel-tech

@Steel-tech Steel-tech commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What & why

claude-sonnet-4-20250514 retired 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

  • New lib/ai/models.ts centralizes the model IDs so the next migration is a one-line change.
  • Routes point at current models:
    • chat + onboarding → claude-sonnet-4-6 (fast/cheap mentor)
    • bid-review → claude-opus-4-8 (deeper contract analysis, low volume)
  • Pure model-ID swap — ran the Claude API migration checklist against each route; no prefill, sampling params, or budget_tokens to remove, and streaming is unchanged, so no client changes needed.

Verification

  • npx tsc --noEmit, npm run lint, npm run build all pass.
  • ⚠️ Not yet verified live. The local .env.local has no ANTHROPIC_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

    • Centralized AI model selection so the chat/onboarding/bid-review flows use the same current Claude model IDs.
    • Updated local config handling by adding an example local configuration file and ignoring local-only machine config overrides.
  • Documentation

    • Added a detailed development roadmap plan for the next major IronForge improvements.
  • CI / Maintenance

    • Removed the CLA assistant automation workflow.

Steel-tech and others added 3 commits June 17, 2026 12:49
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>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea8f623a-630f-4b64-9d16-d5a6613260b1

📥 Commits

Reviewing files that changed from the base of the PR and between 1b3ae56 and 6a603a6.

📒 Files selected for processing (1)
  • .github/workflows/cla.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/cla.yml

📝 Walkthrough

Walkthrough

Introduces a MODELS constant in lib/ai/models.ts centralizing Claude model IDs (MENTOR for fast conversational use, ANALYSIS for deeper analysis), then updates three API routes (bid-review, chat, onboarding) to reference it. Also adds a 400-line IronForge improvement roadmap document outlining 14 sequenced implementation units across four phases, and a Compound Engineering local config example file with a matching .gitignore entry.

Changes

AI Model ID Centralization

Layer / File(s) Summary
MODELS constant
lib/ai/models.ts
Exports a const-asserted MODELS object with MENTOR (claude-sonnet-4-6) and ANALYSIS (claude-opus-4-8) as versioned literal string properties.
API routes wired to MODELS
app/api/bid-review/route.ts, app/api/chat/route.ts, app/api/onboarding/route.ts
Each route adds an import of MODELS and replaces its hard-coded model string with MODELS.ANALYSIS (bid-review) or MODELS.MENTOR (chat, onboarding) in the Anthropic streaming call.

IronForge Roadmap & Tooling Config

Layer / File(s) Summary
IronForge 14-unit roadmap
docs/plans/2026-06-17-001-feat-maximize-ironforge-plan.md
New plan document defining four phases (foundation → growth → depth/polish → breadth), 14 implementation units (U1–U14), a mermaid dependency diagram, key technical decisions, alternatives considered, risk table, scope boundaries, open questions, and sources.
CE local config example and ignore rule
.compound-engineering/config.local.example.yaml, .gitignore
Adds a commented example config for Codex delegation, product pulse, output format defaults, and a Spiral opt-out flag; adds .compound-engineering/\*.local.yaml to .gitignore.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 Three routes once whispered hard-coded names,
Now MODELS speaks clearly — no more guessing games!
A roadmap of fourteen gleams bright in the docs,
While .local.yaml hides behind .gitignore locks.
The warren grows tidy, the configs align,
Hop hop, IronForge — everything's fine! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(ai): migrate off retired Claude model (restores AI endpoints)' directly and clearly summarizes the main change: migrating from a retired Claude model to restore non-functional AI endpoints, which is the primary objective of the entire PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ai-model-retired

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 58a08b2 and 1b3ae56.

📒 Files selected for processing (7)
  • .compound-engineering/config.local.example.yaml
  • .gitignore
  • app/api/bid-review/route.ts
  • app/api/chat/route.ts
  • app/api/onboarding/route.ts
  • docs/plans/2026-06-17-001-feat-maximize-ironforge-plan.md
  • lib/ai/models.ts

Comment on lines +126 to +139
```
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)
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
```
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>
@Steel-tech
Steel-tech merged commit 8297806 into main Jun 18, 2026
1 of 2 checks passed
@Steel-tech
Steel-tech deleted the fix/ai-model-retired branch June 18, 2026 06:18
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