huskies: merge 652_story_pass_resume_session_id_on_agent_respawn_so_new_sessions_inherit_prior_reasoning
This commit is contained in:
@@ -292,6 +292,22 @@ impl AgentPool {
|
||||
.map(|a| a.inactivity_timeout_secs)
|
||||
.unwrap_or(300);
|
||||
|
||||
// If no explicit session_id_to_resume was provided, look up from the
|
||||
// persistent session store. The key includes the model so a model
|
||||
// change (e.g. sonnet → opus) produces a cache miss — intentional.
|
||||
let effective_session_id = session_id_to_resume.or_else(|| {
|
||||
let model = config
|
||||
.find_agent(&resolved_name)
|
||||
.and_then(|a| a.model.clone())
|
||||
.unwrap_or_default();
|
||||
crate::agents::session_store::lookup_session(
|
||||
project_root,
|
||||
story_id,
|
||||
&resolved_name,
|
||||
&model,
|
||||
)
|
||||
});
|
||||
|
||||
// Clone all values needed inside the background spawn.
|
||||
// Spawn the background task. Worktree creation and agent launch happen here
|
||||
// so `start_agent` returns immediately after registering the agent as
|
||||
@@ -300,7 +316,7 @@ impl AgentPool {
|
||||
project_root.to_path_buf(),
|
||||
config.clone(),
|
||||
resume_context.map(str::to_string),
|
||||
session_id_to_resume,
|
||||
effective_session_id,
|
||||
story_id.to_string(),
|
||||
resolved_name.clone(),
|
||||
tx.clone(),
|
||||
|
||||
Reference in New Issue
Block a user