huskies: merge 1015
This commit is contained in:
@@ -42,11 +42,10 @@ impl AgentRuntime for ClaudeCodeRuntime {
|
||||
event_log: Arc<Mutex<Vec<AgentEvent>>>,
|
||||
log_writer: Option<Arc<Mutex<AgentLogWriter>>>,
|
||||
) -> Result<RuntimeResult, String> {
|
||||
let eager_record = if ctx.model.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some((ctx.project_root.clone(), ctx.model.clone()))
|
||||
};
|
||||
let eager_record = ctx
|
||||
.model
|
||||
.as_ref()
|
||||
.map(|m| (ctx.project_root.clone(), m.as_str().to_string()));
|
||||
let pty_result = super::super::pty::run_agent_pty_streaming(
|
||||
&ctx.story_id,
|
||||
&ctx.agent_name,
|
||||
|
||||
@@ -118,7 +118,7 @@ mod tests {
|
||||
session_id_to_resume: None,
|
||||
fresh_prompt: None,
|
||||
project_root: std::path::PathBuf::from("/tmp/project"),
|
||||
model: String::new(),
|
||||
model: None,
|
||||
};
|
||||
|
||||
let instruction = build_system_instruction(&ctx);
|
||||
@@ -139,7 +139,7 @@ mod tests {
|
||||
session_id_to_resume: None,
|
||||
fresh_prompt: None,
|
||||
project_root: std::path::PathBuf::from("/tmp/project"),
|
||||
model: String::new(),
|
||||
model: None,
|
||||
};
|
||||
|
||||
let instruction = build_system_instruction(&ctx);
|
||||
|
||||
@@ -385,7 +385,7 @@ mod tests {
|
||||
session_id_to_resume: None,
|
||||
fresh_prompt: None,
|
||||
project_root: std::path::PathBuf::from("/tmp/project"),
|
||||
model: String::new(),
|
||||
model: None,
|
||||
};
|
||||
|
||||
// The model extraction logic is inside start(), but we test the
|
||||
|
||||
@@ -46,9 +46,9 @@ pub struct RuntimeContext {
|
||||
/// 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,
|
||||
/// Agent model — forms part of the session store key used for eager
|
||||
/// recording (bug 967). `None` disables eager recording.
|
||||
pub model: Option<crate::agents::AgentModel>,
|
||||
}
|
||||
|
||||
/// Result returned by a runtime after the agent session completes.
|
||||
@@ -134,7 +134,7 @@ mod tests {
|
||||
session_id_to_resume: None,
|
||||
fresh_prompt: None,
|
||||
project_root: std::path::PathBuf::from("/tmp/project"),
|
||||
model: "sonnet".to_string(),
|
||||
model: Some(crate::agents::AgentModel::Sonnet),
|
||||
};
|
||||
assert_eq!(ctx.story_id, "42_story_foo");
|
||||
assert_eq!(ctx.agent_name, "coder-1");
|
||||
|
||||
@@ -561,7 +561,7 @@ mod tests {
|
||||
session_id_to_resume: None,
|
||||
fresh_prompt: None,
|
||||
project_root: std::path::PathBuf::from("/tmp/project"),
|
||||
model: String::new(),
|
||||
model: None,
|
||||
};
|
||||
|
||||
assert_eq!(build_system_text(&ctx), "Custom system prompt");
|
||||
@@ -581,7 +581,7 @@ mod tests {
|
||||
session_id_to_resume: None,
|
||||
fresh_prompt: None,
|
||||
project_root: std::path::PathBuf::from("/tmp/project"),
|
||||
model: String::new(),
|
||||
model: None,
|
||||
};
|
||||
|
||||
let text = build_system_text(&ctx);
|
||||
@@ -634,7 +634,7 @@ mod tests {
|
||||
session_id_to_resume: None,
|
||||
fresh_prompt: None,
|
||||
project_root: std::path::PathBuf::from("/tmp/project"),
|
||||
model: String::new(),
|
||||
model: None,
|
||||
};
|
||||
assert!(ctx.command.starts_with("gpt"));
|
||||
}
|
||||
@@ -653,7 +653,7 @@ mod tests {
|
||||
session_id_to_resume: None,
|
||||
fresh_prompt: None,
|
||||
project_root: std::path::PathBuf::from("/tmp/project"),
|
||||
model: String::new(),
|
||||
model: None,
|
||||
};
|
||||
assert!(ctx.command.starts_with("o"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user