fix(runtime): name the session model in the system prompt (#3359)

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.
This commit is contained in:
twtrubiks authored and GitHub committed 2026-10-19 04:52:41 +01:00
1 parent 3cc90cfc7a
commit 66418c6127
4 files changed
+64 -15

No files matched your search

+3 -1
View File
@@ -4374,6 +4374,7 @@ fn build_agent_system_prompt(subagent_type: &str, model: &str) -> Result<Vec<Str
DEFAULT_AGENT_SYSTEM_DATE.to_string(),
std::env::consts::OS,
"unknown",
model,
model_family_identity_for(model),
)
.map_err(|error| error.to_string())?;
@@ -9553,7 +9554,8 @@ mod tests {
// then: the prompt renders a generic model family identity
assert!(prompt.contains("Model family: an AI assistant"));
assert!(!prompt.contains("Model family: Claude Opus 4.6"));
assert!(!prompt.contains("Model family: Claude"));
assert!(prompt.contains("Model: openai/gpt-4.1-mini"));
fs::remove_dir_all(root).expect("cleanup temp workspace");
}