Remember thinking level in last.json too

This commit is contained in:
hermes committed 2026-10-06 12:15:17 +00:00
1 parent ab2af421a4
commit e1143f0b8b
3 files changed
+45 -15

No files matched your search

+14 -4
View File
@@ -502,7 +502,9 @@ async fn main() -> Result<()> {
_ => kind,
};
// the remembered model applies only to the provider it was chosen on
let last_model = last.filter(|l| l.provider == kind).map(|l| l.model);
let last = last.filter(|l| l.provider == kind);
let last_effort = last.as_ref().and_then(|l| l.effort);
let last_model = last.map(|l| l.model);
let model = cli.model.or(cfg.model).or(last_model).unwrap_or_else(|| {
match kind {
Kind::Claude => cfg.claude_model.clone(),
@@ -543,8 +545,16 @@ async fn main() -> Result<()> {
Session::open(&path)?,
cx,
);
let effort = last_effort
.filter(|e| hx_ai::Effort::levels(kind).contains(e))
.unwrap_or(hx_ai::Effort::default_for(kind));
let start = hx_core::switch::Last {
provider: kind,
model: model.clone(),
effort: Some(effort),
};
agent.set_model(model);
agent.set_effort(hx_ai::Effort::default_for(kind));
agent.set_effort(effort);
agent.set_system(context::system_prompt(
cfg.system_prompt.as_deref(),
&context::hx_home(),
@@ -682,7 +692,7 @@ async fn main() -> Result<()> {
Box::new(provider),
cfg.compact_at.is_none(),
)
.remember_in(last_path.clone()),
.remember_in(last_path.clone(), start.clone()),
},
)
.await;
@@ -701,7 +711,7 @@ async fn main() -> Result<()> {
Box::new(provider),
cfg.compact_at.is_none(),
)
.remember_in(last_path),
.remember_in(last_path, start),
pricing,
specs,
open_sessions,