actions: emit needs_login after first spawn, fix update_meta_inputs arity
This commit is contained in:
parent
6ca72074c4
commit
55fe2856b9
1 changed files with 24 additions and 7 deletions
|
|
@ -89,7 +89,7 @@ pub async fn approve(coord: Arc<Coordinator>, id: i64) -> Result<()> {
|
||||||
let inputs: Vec<String> =
|
let inputs: Vec<String> =
|
||||||
serde_json::from_str(&approval.commit_ref).unwrap_or_default();
|
serde_json::from_str(&approval.commit_ref).unwrap_or_default();
|
||||||
let result = crate::meta::lock_update(&inputs).await;
|
let result = crate::meta::lock_update(&inputs).await;
|
||||||
finish_approval(&coord, &approval, result, None)
|
finish_approval(&coord, &approval, result, None, false)
|
||||||
}
|
}
|
||||||
ApprovalKind::Spawn => {
|
ApprovalKind::Spawn => {
|
||||||
// Run the spawn in the background so the approve POST returns
|
// Run the spawn in the background so the approve POST returns
|
||||||
|
|
@ -210,12 +210,24 @@ fn finish_approval(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ApprovalKind::Spawn => coord.notify_manager(&HelperEvent::Spawned {
|
ApprovalKind::Spawn => {
|
||||||
agent: approval.agent.clone(),
|
coord.notify_manager(&HelperEvent::Spawned {
|
||||||
ok,
|
agent: approval.agent.clone(),
|
||||||
note,
|
ok,
|
||||||
sha: approval.fetched_sha.clone(),
|
note,
|
||||||
}),
|
sha: approval.fetched_sha.clone(),
|
||||||
|
});
|
||||||
|
// Newly spawned container has no claude session yet. Emit
|
||||||
|
// NeedsLogin immediately so the manager prompts the operator
|
||||||
|
// rather than waiting for crash_watch (which would miss it
|
||||||
|
// because the agent appears simultaneously in both prev_needs
|
||||||
|
// and current_needs, making the diff empty on the first tick).
|
||||||
|
if ok {
|
||||||
|
coord.notify_manager(&HelperEvent::NeedsLogin {
|
||||||
|
agent: approval.agent.clone(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
ApprovalKind::ApplyCommit if is_first_spawn => {
|
ApprovalKind::ApplyCommit if is_first_spawn => {
|
||||||
coord.notify_manager(&HelperEvent::Spawned {
|
coord.notify_manager(&HelperEvent::Spawned {
|
||||||
agent: approval.agent.clone(),
|
agent: approval.agent.clone(),
|
||||||
|
|
@ -223,6 +235,11 @@ fn finish_approval(
|
||||||
note,
|
note,
|
||||||
sha: approval.fetched_sha.clone(),
|
sha: approval.fetched_sha.clone(),
|
||||||
});
|
});
|
||||||
|
if ok {
|
||||||
|
coord.notify_manager(&HelperEvent::NeedsLogin {
|
||||||
|
agent: approval.agent.clone(),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ApprovalKind::ApplyCommit => coord.notify_manager(&HelperEvent::Rebuilt {
|
ApprovalKind::ApplyCommit => coord.notify_manager(&HelperEvent::Rebuilt {
|
||||||
agent: approval.agent.clone(),
|
agent: approval.agent.clone(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue