obra / obra/episodic-memory

Bundled Agent SDK 0.2.x clobbers newer models out of the Claude Code model picker (shared additionalModelOptionsCache wipe)

Open Beginner friendly
#112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-categorization
Dominant language
TypeScript
Stars
478
Forks
139
Avg merge
8h 14m
Merged PRs (30d)
3

Description

Summary

episodic-memory's background sync silently removes newly-released models (e.g. Fable) from the host Claude Code model picker on every session launch. The plugin pins @anthropic-ai/claude-agent-sdk at ^0.2.126; the SDK's embedded CLI identifies as claude-code/2.1.141, and Anthropic's /api/claude_cli/bootstrap endpoint version-gates its model-options payload — pre-Fable clients receive additional_model_options: null. The old embedded CLI then persists null ?? [] into the shared ~/.claude.json additionalModelOptionsCache, overwriting the entry the user's real (current) CLI wrote seconds earlier.

Result for the user: the new model appears in the picker for ~3–5 seconds after launch (until the SessionStart sync's first summarization job fires), then vanishes. Selecting it within that window works, which makes it look like an entitlement flake. It reproduces on every launch whenever the sync has anything to summarize — and because failed summaries are retried (see #96), it effectively reproduces on every launch.

Evidence

mitmproxy capture of one claude -p ok launch (host CLI 2.1.170, plugin 1.4.1, SDK 0.2.141, macOS):

  • Host session bootstrap — User-Agent: claude-code/2.1.170 → response contains additional_model_options: [{"model":"claude-fable-5[1m]","name":"Fable",...}]
  • Two sync-summarizer bootstraps — User-Agent: claude-code/2.1.141, model=claude-haiku-4-5-… → response has additional_model_options: null (same account, same OAuth token, same client_data entitlement flags)
  • File watcher on ~/.claude.json: Fable entry written by the host at T, replaced by [] at T+1s by the SDK child.

Safe mode (claude --disable-all-hooks-equivalent) is immune — no plugins, no sync — which is what initially misdirected debugging toward entitlement/account issues.

Fix

Bump the dependency to the current SDK line (^0.3.x; 0.3.170 pairs with CLI 2.1.170). I verified locally that:

  • the plugin's only SDK API usage is query(), which is unchanged in 0.3.x;
  • after npm install @anthropic-ai/claude-agent-sdk@0.3.170 in the plugin directory, sync runs fine and the picker entry survives launches (same repro recipe, zero wipes).

More durably, you may want to pin/refresh the SDK on each release, since any future model launch will re-trigger this for every user still on an older bundled SDK.

(Arguably also an upstream Anthropic bug — an older CLI shouldn't persist a version-gated empty model list over a newer client's shared cache — but bumping the SDK fixes it for this plugin today.)

Environment

  • episodic-memory 1.4.1 (superpowers-marketplace), @anthropic-ai/claude-agent-sdk 0.2.141 (resolved from ^0.2.126)
  • Host Claude Code 2.1.170 (Homebrew cask), macOS (Darwin 25.4.0)
  • Account: Claude Max (Fable entitlement confirmed server-side in every capture)

🤖 Diagnosed and written with Claude Code

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the plugin directory by locating the dependency entry for @anthropic-ai/claude-agent-sdk and review its current resolved version. Update it to the 0.3.x line, install the dependency, and run the sync launch reproduction; done means summarization completes and the newer model remains in the Claude Code picker across launches.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.