Skip to content

fix(claude-code-plugin): improve SETUP.md + fix Anthropic temperature/top_p conflict#2

Open
lightzt99 wants to merge 1 commit into
mainfrom
doc/improve-claude-code-setup
Open

fix(claude-code-plugin): improve SETUP.md + fix Anthropic temperature/top_p conflict#2
lightzt99 wants to merge 1 commit into
mainfrom
doc/improve-claude-code-setup

Conversation

@lightzt99

@lightzt99 lightzt99 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Auto-detect LLM config from ~/.claude/settings.json in Step 2
  • Document Anthropic model name normalization rule (dots → dashes)
  • Fix plugin uninstall idempotency (2>/dev/null || true)
  • Parallelize embedding model download with hook build / plugin staging
  • Add error entry [E010] for Anthropic temperature+top_p conflict
  • Bug fix: AnthropicLLM.generate_response now drops top_p before calling the API

Motivation

Six failure modes were observed in the original PR. This update addresses three more
discovered during actual setup on macOS:

# Problem Impact
7 settings.json model names use dots (4.6) but Anthropic API requires dashes (4-6) 404 invalid_model
8 plugin uninstall fails with exit code 1 when plugin not yet installed Setup script aborts mid-run
9 AnthropicLLM sends both temperature and top_p to Anthropic API 400 invalid_params — every memory write silently drops all extracted facts

Issue 9 was verified by direct API call: sending both parameters always returns
400 - temperature and top_p cannot both be specified for this model.

Changes

File What changed
apps/claude-code-plugin/SETUP.md Auto-detect flow, model name normalization note, parallel model download, uninstall || true, [E010] error entry
src/powermem/integrations/llm/anthropic.py params.pop("top_p", None) before client.messages.create()

Test plan

  • Confirm no API key echoes in the setup flow
  • Confirm ModelScope download + bridge script produces a cache that try_to_load_from_cache recognizes
  • Confirm polling health check waits correctly on a slow first launch
  • Direct API verification: temperature+top_p → 400; temperature-only → 200; top_p-only → 200
  • Full setup round-trip: write probe memory, search returns dragonfruit-zx9, cleanup, global hook calls confirmed in server.log

@lightzt99 lightzt99 changed the title docs(claude-code-plugin): harden SETUP.md — key masking, config flow, install fixes docs(claude-code-plugin): improve SETUP.md — key masking, config flow, install fixes Jun 3, 2026
@lightzt99
lightzt99 force-pushed the doc/improve-claude-code-setup branch 2 times, most recently from 643b1c5 to a5094b1 Compare June 4, 2026 12:36
@lightzt99 lightzt99 changed the title docs(claude-code-plugin): improve SETUP.md — key masking, config flow, install fixes fix(claude-code-plugin): improve SETUP.md + fix Anthropic temperature/top_p conflict Jun 4, 2026
@lightzt99
lightzt99 force-pushed the doc/improve-claude-code-setup branch from a5094b1 to 3ad9507 Compare June 4, 2026 12:45
…/top_p conflict

SETUP.md improvements:
- Step 2: add auto-detect flow reading LLM config from ~/.claude/settings.json
- Step 2: document Anthropic model name normalization (dots → dashes, e.g.
  claude-sonnet-4.6 → claude-sonnet-4-6); settings.json uses dots, API requires dashes
- Step 3a: move embedding model download to background immediately after pip install,
  so it runs in parallel with hook build and plugin staging
- Step 3a: fix plugin uninstall idempotency — add `2>/dev/null || true` to swallow
  "not found" error when plugin was never installed
- Error guide: add [E010] Anthropic temperature+top_p conflict — diagnosis and fix

Bug fix:
- AnthropicLLM.generate_response: pop top_p before sending to Anthropic API.
  Anthropic rejects requests where both temperature and top_p are specified (400).
  Verified with direct API call: temperature-only and top_p-only both succeed;
  sending both always returns 400 invalid_params.

Co-Authored-By: Claude Sonnet 4 <[email protected]>
@lightzt99
lightzt99 force-pushed the doc/improve-claude-code-setup branch from 3ad9507 to 2356383 Compare June 4, 2026 13:17
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