huskies: merge 967

This commit is contained in:
dave
2026-05-13 12:34:35 +00:00
parent 40ea100eae
commit 93f774fcbb
9 changed files with 165 additions and 0 deletions
+10
View File
@@ -41,6 +41,14 @@ pub struct RuntimeContext {
/// resume (session expired, file missing, version mismatch), the runtime
/// retries with this full prompt and no `--resume` flag.
pub fresh_prompt: Option<String>,
/// Project root path — passed to the PTY runner so it can eagerly record
/// the session_id as soon as the `"system"` event is seen (bug 967).
/// Eager recording ensures the session survives a watchdog kill that aborts
/// the tokio task before `run_agent_spawn`'s `record_session()` call runs.
pub project_root: std::path::PathBuf,
/// Agent model name — forms part of the session store key used for eager
/// recording (bug 967). An empty string disables eager recording.
pub model: String,
}
/// Result returned by a runtime after the agent session completes.
@@ -125,6 +133,8 @@ mod tests {
app_ctx: Some(test_app_ctx()),
session_id_to_resume: None,
fresh_prompt: None,
project_root: std::path::PathBuf::from("/tmp/project"),
model: "sonnet".to_string(),
};
assert_eq!(ctx.story_id, "42_story_foo");
assert_eq!(ctx.agent_name, "coder-1");