Repository navigation
Conversation
The environment section rendered "Model family: Claude Opus 4.6" for every Anthropic model, so claude-opus-5-5, claude-sonnet-4-6, and any other Claude model told users it was Opus 4.6. Render a neutral "Claude" family label followed by the resolved model ID, and rebuild the system prompt on /model so the line follows a mid-session switch instead of keeping the startup model.
|
Fix looks correct: hardcoding |
|
这个修复很到位:直接在 system prompt 里写入实际解析的模型 ID,而不是硬编码固定的 Claude 版本,从根上解决了模型自报身份错误的问题。附带把 /model 切换后旧 prompt 残留的问题也一并修了,很关键。复现路径清晰、改动集中,测试也覆盖了默认/非 Anthropic 模型身份,支持合并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
# Environment contextsection of the system prompt hardcodesModel family: Claude Opus 4.6(FRONTIER_MODEL_NAME) for every Anthropic model. As a resultclaude-opus-5-5,claude-sonnet-4-6, and every other Claude model answer "I am Claude Opus 4.6" when asked which model they are, even though the request goes to the configured model.Claude, followed by aModel: <resolved model id>line. Non-Anthropic models keep the neutralan AI assistantlabel from Non-Anthropic providers inherit hardcoded Claude identity in system prompt #2822 and get their model ID line too./modelreused the system prompt built at startup, so after a switch the prompt would still name the previous model.set_modelnow rebuilds the system prompt for the new model.FRONTIER_MODEL_NAMEis removed (it had no other users).load_system_promptandload_system_prompt_with_contexttake the model ID as a new argument; all three callers (the CLI runtime, thesystem-promptcommand, and sub-agents) already had it in scope.This is independent of #3355–#3358 and merges cleanly with each of them.
Anti-slop triage
renders_configured_model_instead_of_a_fixed_claude_version; updatedrenders_default_claude_model_family_identity,renders_generic_model_family_identity_without_claude_label, andsubagent_system_prompt_uses_resolved_model_identity.Reproduction
claw --model claude-opus-5-5 system-prompt | grep "Model family"printsModel family: Claude Opus 4.6.claw --model claude-opus-5-5, ask "which model are you?" → the model says it is Claude Opus 4.6.After the fix,
system-promptprints both lines above and the model identifies itself asclaude-opus-5-5.Verification
scripts/fmt.sh --checkcargo test -p runtime -p tools -p rusty-claude-cli: all pass excepttools::tests::powershell_runs_via_stub_shell, which fails locally only becausepwshis not installed (same onmain).cargo clippy -p runtime -p tools -p rusty-claude-cli --all-targets: no new warnings in the touched code.claude-opus-5-5which model it is; it namedclaude-opus-5-5./model: pointedANTHROPIC_BASE_URLat a local server that records request bodies and returns a canned stream. In one REPL session I sent a prompt, ran/model claude-haiku-4-5, and sent another. The first request hadmodel: claude-opus-5-5and- Model: claude-opus-5-5; the second hadmodel: claude-haiku-4-5and- Model: claude-haiku-4-5. I checked the request bodies directly because asking the model to quote its own prompt was not reliable.git diff --checkpasses.Compatibility and known gaps
runtimeAPI:FRONTIER_MODEL_NAMEis removed andload_system_prompt*gain amodelparameter. All callers are inside the workspace and are updated here./modelalso re-reads git status and instruction files at that point, the same work done at startup. The prompt cache is invalidated by a model switch anyway.# Runtime configsection still embeds the raw settings JSON. If settings set"model"and--modeloverrides it, the model sees both values; it picks the active one from theModel:line. I left that section unchanged.Resolution gate