Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/flare-git-core/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ pub fn run_in_lines_bounded(
.stdout(Stdio::piped())
.stderr(Stdio::piped());
no_console_window(&mut cmd);
apply_filtered_path(&mut cmd);
let mut child = cmd
.spawn()
.map_err(|e| BoundedLinesError::Git(format!("git not available: {e}")))?;
Expand Down
44 changes: 30 additions & 14 deletions src/dashboard/orphan_reconcile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,39 @@ fn restore_ready_for_work(mcp: &crate::mcp_server::AgentflareMcp, item_id: &str,
.iter()
.find(|l| l.name == crate::supervisor::READY_LABEL)?
.id;
if let Some(dispatched_id) = labels
let dispatched_id = labels
.iter()
.find(|l| l.name == crate::supervisor::DISPATCHED_LABEL)
{
let _ = agentflare_backend::item::remove_label(conn, item_id, &dispatched_id.id);
.map(|l| l.id.clone());

// Single transaction: a failure partway through must not leave the
// item labeled ready-for-work with no assignee (item #150) or with
// `dispatched` still attached (item #99) -- `with_backend_db` gives
// no rollback of its own, so this crate does it explicitly instead
// of discarding a mid-sequence error via `.ok()?` and continuing.
conn.execute_batch("BEGIN").ok()?;
let result: agentflare_backend::error::Result<()> = (|| {
if let Some(dispatched_id) = &dispatched_id {
agentflare_backend::item::remove_label(conn, item_id, dispatched_id)?;
}
agentflare_backend::item::update(
conn,
item_id,
agentflare_backend::item::UpdateItem {
assignee_agent: Some(agent.to_string()),
..Default::default()
},
)?;
agentflare_backend::item::add_label(conn, item_id, ready_id)?;
Ok(())
})();
match result {
Ok(()) => conn.execute_batch("COMMIT").ok(),
Err(_) => {
let _ = conn.execute_batch("ROLLBACK");
None
}
}
agentflare_backend::item::add_label(conn, item_id, ready_id).ok()?;
agentflare_backend::item::update(
conn,
item_id,
agentflare_backend::item::UpdateItem {
assignee_agent: Some(agent.to_string()),
..Default::default()
},
)
.ok()?;
Some(())
});
}

Expand Down
Loading