Skip to content

Memory sidecar is dead on Claude credentials: SIDECAR_CLAUDE_MODEL uses the Haiku 3.5 date, 404s on every call #798

Description

@MatrixMagician

Problem

The memory sidecar's Claude model is pinned to claude-haiku-4-5-20241022:

https://github.com/1jehuang/jcode/blob/master/crates/jcode-base/src/sidecar.rs#L22

20241022 is the Haiku 3.5 snapshot date. Paired with a claude-haiku-4-5 base it forms an id Anthropic does not publish, so every sidecar call on the Claude path returns 404 not_found_error.

Verified against the live API with jcode's own OAuth credentials and headers:

claude-haiku-4-5-20241022      HTTP 404  {"type":"error","error":{"type":"not_found_error","message":"model: claude-haiku-4-5-20241022"},...}
claude-haiku-4-5-20251001      HTTP 200  {"content":[{"type":"text","text":"OK"}],...}

GET /v1/models confirms claude-haiku-4-5-20251001 is the only Haiku in the catalogue, so the correct id is unambiguous.

The failure is near-silent, which is why it survived so long. rerank_candidates_consensus_attributed catches the transport error, logs it rate-limited, and arms a circuit breaker:

[WARN] EVENT event="Memory consensus judge failed; circuit breaker armed" error="Claude API error (404 Not Found): ... model: claude-haiku-4-5-20241022 ..."

After that the breaker suppresses the judge for the rest of the session. Nothing surfaces to the user, and since the judge is the only thing allowed to surface memory, memory recall silently degrades rather than erroring.

git log -S dates the bad id to the original feat: add Haiku 4.5 sidecar for memory system commit, so the Claude sidecar path has never worked. Users on Codex credentials are unaffected (they select SIDECAR_OPENAI_MODEL); only Claude-credentialed users without Codex creds hit it.

Every other reference in the tree already uses the correct id (auth/lifecycle.rs, provider-core/anthropic.rs, provider-core/model_id.rs, tui/model_names.rs). sidecar.rs is the sole outlier.

Expected behavior

  • The sidecar's Claude model is an id the Anthropic catalogue actually publishes.
  • A wrong model id does not degrade into a silently-disabled feature.

Fix

  1. Pin SIDECAR_CLAUDE_MODEL to claude-haiku-4-5-20251001, matching the rest of the codebase.
  2. Add a regression test asserting the id is a dated Haiku snapshot and specifically rejecting the 3.5 date, so a family/date mismatch cannot recur.

Affected file:

  • crates/jcode-base/src/sidecar.rs

I have this fixed and tested locally (1252/1252 jcode-base tests pass) and am happy to open a PR.

Possible follow-up

The near-silence is arguably the more valuable fix. A 404 not_found_error is a permanent configuration fault, not a transient transport failure, yet record_failure_backoff treats them identically. Distinguishing "this model does not exist" from "the network blipped" and surfacing the former once at startup would have made this immediately visible instead of invisible for the feature's entire lifetime. Happy to file that separately if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: likelyProbably hands-off: clearly worth fixing, agent can do it, minor judgment needed.bugSomething isn't workingtriage: fixed-pending-releaseFixed in code/committed; will close automatically on next releasetriage: reproducibleClear repro + clear fix path

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions