Skip to content

fix: stop using retired claude-3-haiku-20240307 for Anthropic key checks and defaults - #2555

Closed
kamal0808 wants to merge 1 commit into
MemTensor:dev-v2.0.36from
kamal0808:fix/retired-claude-3-haiku
Closed

kamal0808 wants to merge 1 commit into
MemTensor:dev-v2.0.36from
kamal0808:fix/retired-claude-3-haiku

Conversation

@kamal0808

Copy link
Copy Markdown

Description

Anthropic retired claude-3-haiku-20240307 on April 20, 2026 (model deprecations), so requests to it now fail. A few places in MemOS still hardcode it:

  • Openwork desktop, API key check (api-key:validate and api-key:validate-provider in handlers.ts): the check sends a message to claude-3-haiku-20240307 and treats any non-OK reply as a bad key. Since the model is gone, every valid Anthropic key is rejected and users can't get past setup.
  • Summarizer default (shared/llm-call.ts and ingest/providers/anthropic.ts, in both packages/memos-core and apps/memos-local-openclaw): with provider: anthropic and no model set, every summarize/topic/dedup call fails.
  • Viewer "test connection" (viewer/server.ts, both copies): with no model entered, the test always fails.

What changed:

  • The desktop key check now calls GET https://api.anthropic.com/v1/models instead of sending a message, the same way the OpenAI check already works. It still returns 401 for a bad key, costs no tokens, and won't break again when the next model retires.
  • The fallback model is now claude-haiku-4-5-20251001, Anthropic's listed replacement for Haiku 3. It still accepts the temperature these calls send.
  • The README / SKILL.md summarizer example uses the same model.
  • Updated the api-key:validate unit test to check the new endpoint and added one for api-key:validate-provider with anthropic.

Bedrock defaults (anthropic.claude-3-haiku-20240307-v1:0) are untouched: Bedrock has its own retirement schedule.

There's no issue for this one; I found it while reading the code.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I haven't run the test suite or the app locally. The changes are a model ID swap and an endpoint swap for the key check, plus the unit tests above. CI should cover them.

🤖 Generated with Claude Code

…cks and defaults

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Memtensor-AI Memtensor-AI added area:plugin OpenClaw & Hermes status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Nov 1, 2026
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

🤖 Open Code Review

Target: PR #2555
Task: 87d232cc2f3fa554
Base: dev-v2.0.36
Head: fix/retired-claude-3-haiku

🔍 OpenCodeReview found 6 issue(s) in this PR.

⚠️ Review warnings (1)

  • Filtered 1 low-confidence OCR finding(s) before posting/fix-loop.

1. packages/memos-core/src/ingest/providers/anthropic.ts (L63)

Bumping the provider default here (and in llm-call.ts / viewer/server.ts) leaves the viewer settings UI's per-provider prefill stale: _providerDefaults.anthropic.chatModel is still 'claude-3-haiku-20240307' in packages/memos-core/src/viewer/html.ts:7233 and apps/memos-local-openclaw/src/viewer/html.ts:7248. Since onProviderChange() writes that value into the cfgSumModel/cfgSkillModel inputs, anyone who configures Anthropic through the viewer ends up persisting the old deprecated model as cfg.model, which then takes precedence over the new default — i.e. the PR's intent is silently defeated for UI-configured installations. Please update both copies to the new model id as part of this change.


2. apps/memos-local-openclaw/src/shared/llm-call.ts (L172)

The new default is only used when cfg.model is empty, but the viewer still fills in the old model id, so this bump won't take effect for the normal UI path: _providerDefaults.anthropic.chatModel in src/viewer/html.ts is still 'claude-3-haiku-20240307' (onProviderChange writes it into cfgSumModel / cfgSkillModel whenever the field is blank). Also, this same literal is duplicated 7x in src/ingest/providers/anthropic.ts and once here, so future bumps will keep drifting. Consider extracting a shared DEFAULT_ANTHROPIC_MODEL constant and reusing it in the viewer defaults too.


3. packages/memos-core/src/shared/llm-call.ts (L170)

The new default is only used when cfg.model is empty, but the viewer still fills in the old model id, so this bump won't take effect for the normal UI path: _providerDefaults.anthropic.chatModel in src/viewer/html.ts is still 'claude-3-haiku-20240307' (onProviderChange writes it into cfgSumModel / cfgSkillModel whenever the field is blank). Also, this same literal is duplicated 7x in src/ingest/providers/anthropic.ts and once here, so future bumps will keep drifting. Consider extracting a shared DEFAULT_ANTHROPIC_MODEL constant and reusing it in the viewer defaults too.


4. packages/memos-core/src/viewer/server.ts (L3932)

This fallback only fires when model is empty, but the viewer settings UI still prefills anthropic: { endpoint: 'https://api.anthropic.com/v1/messages', chatModel: 'claude-3-haiku-20240307' } (packages/memos-core/src/viewer/html.ts ~line 7233), so the connection test will keep sending the old model. Update that UI default in the same change, otherwise this model bump is effectively inert. (Same applies to the duplicated copy in apps/memos-local-openclaw/src/viewer/server.ts + html.ts.)


5. apps/memos-local-openclaw/src/viewer/server.ts (L4009)

Same mismatch exists in this app's packaged copy: this fallback only applies when model is empty, but the viewer settings UI still prefills the deprecated model claude-3-haiku-20240307 (apps/memos-local-openclaw/src/viewer/html.ts _providerDefaults.anthropic.chatModel, ~line 7248). So the "test connection" button will keep sending claude-3-haiku-20240307 and never hit this new fallback. Please update the anthropic provider default in html.ts (in both this app and packages/memos-core) so the whole flow uses the new model.

💡 Suggested Change

Before:

        body: JSON.stringify({ model: model || "claude-haiku-4-5-20251001", max_tokens: 5, messages: [{ role: "user", content: "hi" }] }),

After:

        body: JSON.stringify({ model: model || "claude-haiku-4-5-20251001", max_tokens: 5, messages: [{ role: "user", content: "hi" }] }),

6. apps/openwork-memos-integration/apps/desktop/src/main/ipc/handlers.ts (L818-L820)

The Anthropic validation request is now duplicated verbatim in api-key:validate and in the case 'anthropic' branch of api-key:validate-provider (this PR had to patch both). Keeping two copies of the same URL/headers in sync is error-prone; consider extracting a small shared helper (e.g. validateAnthropicKey(key)) or at least a constant for the endpoint + version, so future endpoint/version changes only need one edit.


🧹 Filtered 1 low-confidence OCR finding(s) before posting/fix-loop (duplicate: 1).

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

⚠️ Automated Test Results: ENV ISSUE

The test environment encountered an issue that requires manual attention.

Details: Pytest result is missing or invalid. Automated validation remains blocked.
[memos_local_plugin] required-scope-unexecuted: Command failed with exit code 1: bash /data/test-workspaces/87d232cc2f3fa554/repo/apps/memos-local-plugin/install.sh --version /data/test-workspaces/87d232cc2f3fa554/repo/apps/memos-local-plugin/memtensor-memos-local-plugin-2.0.16-beta.1.tgz --agent openclaw
stdout:
�[1m�[0;34m┌──────────────────────────────────────────────────┐�[0m
�[1m�[0;34m│�[0m �[1m�[0;3
... [truncated; full output retained as artifact] ...
�[1m�[0;31m│�[0m
�[1m�[0;31m│�[0m �[0;31mInstall finished with errors - see above�[0m �[1m�[0;31m│�[0m
�[1m�[0;31m│�[0m �[1m�[0;31m│�[0m
�[1m�[0;31m└──────────────────────────────────────────────────┘�[0m

stderr: �[1;33m⚠�[0m Local MiniLM model weights are not bundled.
�[0;31m✘�[0m openclaw gateway start failed:
Gateway start failed: Error: systemctl not available; systemd user services are required on Linux.
Tip: openclaw gateway install
Tip: openclaw gateway
Tip: systemctl --user start openclaw-gateway.service
�[1;33m⚠�[0m Inspect ~/.openclaw/logs/gateway.err.log for the full reason.
Branch: fix/retired-claude-3-haiku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugin OpenClaw & Hermes status:in-progress Someone or AI is working on it | 人工或 AI 正在处理

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants