mirror of
https://github.com/instructkr/claw-code.git
synced 2026-11-19 00:00:00 +08:00
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:
1 parent
3cc90cfc7a
commit
66418c6127
4 files changed
+64
-15
No files matched your search
@@ -5012,6 +5012,7 @@ fn print_system_prompt(
|
||||
date,
|
||||
env::consts::OS,
|
||||
"unknown",
|
||||
model,
|
||||
model_family_identity_for(model),
|
||||
)?;
|
||||
let (project_root, _) =
|
||||
@@ -8749,11 +8750,12 @@ impl LiveCli {
|
||||
let previous = self.model.clone();
|
||||
let session = self.runtime.session().clone();
|
||||
let message_count = session.messages.len();
|
||||
let system_prompt = build_system_prompt(&model)?;
|
||||
let runtime = build_runtime(
|
||||
session,
|
||||
&self.session.id,
|
||||
model.clone(),
|
||||
self.system_prompt.clone(),
|
||||
system_prompt.clone(),
|
||||
true,
|
||||
true,
|
||||
TerminalTail::new(),
|
||||
@@ -8763,6 +8765,7 @@ impl LiveCli {
|
||||
)?;
|
||||
self.replace_runtime(runtime)?;
|
||||
self.model.clone_from(&model);
|
||||
self.system_prompt = system_prompt;
|
||||
println!(
|
||||
"{}",
|
||||
format_model_switch_report(&previous, &model, message_count)
|
||||
@@ -12360,6 +12363,7 @@ fn build_system_prompt(model: &str) -> Result<Vec<String>, Box<dyn std::error::E
|
||||
DEFAULT_DATE,
|
||||
env::consts::OS,
|
||||
"unknown",
|
||||
model,
|
||||
model_family_identity_for(model),
|
||||
)?)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user