huskies: merge 543_story_resume_failed_coder_agents_with_resume_instead_of_starting_fresh_sessions
This commit is contained in:
@@ -52,6 +52,7 @@ impl AgentRuntime for ClaudeCodeRuntime {
|
||||
ctx.inactivity_timeout_secs,
|
||||
Arc::clone(&self.child_killers),
|
||||
self.watcher_tx.clone(),
|
||||
ctx.session_id_to_resume.as_deref(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
||||
@@ -707,6 +707,7 @@ mod tests {
|
||||
cwd: "/tmp/wt".to_string(),
|
||||
inactivity_timeout_secs: 300,
|
||||
mcp_port: 3001,
|
||||
session_id_to_resume: None,
|
||||
};
|
||||
|
||||
let instruction = build_system_instruction(&ctx);
|
||||
@@ -724,6 +725,7 @@ mod tests {
|
||||
cwd: "/tmp/wt".to_string(),
|
||||
inactivity_timeout_secs: 300,
|
||||
mcp_port: 3001,
|
||||
session_id_to_resume: None,
|
||||
};
|
||||
|
||||
let instruction = build_system_instruction(&ctx);
|
||||
@@ -800,6 +802,7 @@ mod tests {
|
||||
cwd: "/tmp".to_string(),
|
||||
inactivity_timeout_secs: 300,
|
||||
mcp_port: 3001,
|
||||
session_id_to_resume: None,
|
||||
};
|
||||
|
||||
// The model extraction logic is inside start(), but we test the
|
||||
|
||||
@@ -25,6 +25,12 @@ pub struct RuntimeContext {
|
||||
/// Port of the huskies MCP server, used by API-based runtimes (Gemini, OpenAI)
|
||||
/// to call back for tool execution.
|
||||
pub mcp_port: u16,
|
||||
/// When set, resume a previous Claude Code session instead of starting fresh.
|
||||
///
|
||||
/// The CLI is invoked as `claude --resume <session_id> [-p <prompt>]` rather
|
||||
/// than `claude -p <full_prompt>`. The agent re-enters the previous
|
||||
/// conversation and receives the `prompt` (if non-empty) as a new message.
|
||||
pub session_id_to_resume: Option<String>,
|
||||
}
|
||||
|
||||
/// Result returned by a runtime after the agent session completes.
|
||||
@@ -93,6 +99,7 @@ mod tests {
|
||||
cwd: "/tmp/wt".to_string(),
|
||||
inactivity_timeout_secs: 300,
|
||||
mcp_port: 3001,
|
||||
session_id_to_resume: None,
|
||||
};
|
||||
assert_eq!(ctx.story_id, "42_story_foo");
|
||||
assert_eq!(ctx.agent_name, "coder-1");
|
||||
|
||||
@@ -618,6 +618,7 @@ mod tests {
|
||||
cwd: "/tmp/wt".to_string(),
|
||||
inactivity_timeout_secs: 300,
|
||||
mcp_port: 3001,
|
||||
session_id_to_resume: None,
|
||||
};
|
||||
|
||||
assert_eq!(build_system_text(&ctx), "Custom system prompt");
|
||||
@@ -634,6 +635,7 @@ mod tests {
|
||||
cwd: "/tmp/wt".to_string(),
|
||||
inactivity_timeout_secs: 300,
|
||||
mcp_port: 3001,
|
||||
session_id_to_resume: None,
|
||||
};
|
||||
|
||||
let text = build_system_text(&ctx);
|
||||
@@ -683,6 +685,7 @@ mod tests {
|
||||
cwd: "/tmp".to_string(),
|
||||
inactivity_timeout_secs: 300,
|
||||
mcp_port: 3001,
|
||||
session_id_to_resume: None,
|
||||
};
|
||||
assert!(ctx.command.starts_with("gpt"));
|
||||
}
|
||||
@@ -698,6 +701,7 @@ mod tests {
|
||||
cwd: "/tmp".to_string(),
|
||||
inactivity_timeout_secs: 300,
|
||||
mcp_port: 3001,
|
||||
session_id_to_resume: None,
|
||||
};
|
||||
assert!(ctx.command.starts_with("o"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user