huskies: merge 962
This commit is contained in:
@@ -165,7 +165,7 @@ pub fn get_work_item_content(
|
||||
let crdt_name = crdt_view.as_ref().map(|v| v.name().to_string());
|
||||
let crdt_agent = crdt_view
|
||||
.as_ref()
|
||||
.and_then(|v| v.agent().map(str::to_string));
|
||||
.and_then(|v| v.agent().map(|a| a.to_string()));
|
||||
|
||||
for (stage_dir, stage) in &stages {
|
||||
if let Some(content) = io::read_work_item_from_stage(&work_dir, stage_dir, &filename)? {
|
||||
|
||||
@@ -25,7 +25,10 @@ pub async fn assign_and_start(
|
||||
project_root: &Path,
|
||||
agents: &AgentPool,
|
||||
) -> Result<AgentInfo, String> {
|
||||
crate::crdt_state::set_agent(story_id, Some(agent_name));
|
||||
crate::crdt_state::set_agent(
|
||||
story_id,
|
||||
agent_name.parse::<crate::config::AgentName>().ok(),
|
||||
);
|
||||
agents
|
||||
.start_agent(project_root, story_id, Some(agent_name), None, None)
|
||||
.await
|
||||
@@ -114,10 +117,10 @@ mod tests {
|
||||
let agents = make_agents();
|
||||
|
||||
// Simulate Matrix path: call assign_and_start directly (as handle_assign does).
|
||||
let _ = assign_and_start(story_id_a, "coder-sonnet", tmp.path(), &agents).await;
|
||||
let _ = assign_and_start(story_id_a, "coder-opus", tmp.path(), &agents).await;
|
||||
|
||||
// Simulate MCP path: call assign_and_start directly (as tool_start_agent does).
|
||||
let _ = assign_and_start(story_id_b, "coder-sonnet", tmp.path(), &agents).await;
|
||||
let _ = assign_and_start(story_id_b, "coder-opus", tmp.path(), &agents).await;
|
||||
|
||||
// Both must leave the same CRDT agent register value.
|
||||
for sid in &[story_id_a, story_id_b] {
|
||||
@@ -129,7 +132,7 @@ mod tests {
|
||||
.expect("item must be in CRDT");
|
||||
assert_eq!(
|
||||
item.agent.as_deref(),
|
||||
Some("coder-sonnet"),
|
||||
Some("coder-opus"),
|
||||
"CRDT agent register must match for story {sid}"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user