mirror of
https://github.com/block/buzz.git
synced 2026-10-27 12:40:30 +00:00
Fix zombie agent detection and surface stopped agent cleanup (#380)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -129,12 +129,9 @@ pub fn validate_imeta_tags(tags: &[Vec<String>], media_base_url: &str) -> Result
|
|||||||
return Err("imeta duration must be a valid float".into());
|
return Err("imeta duration must be a valid float".into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"bitrate" => {
|
"bitrate" if value.parse::<u64>().map_or(true, |b| b == 0) => {
|
||||||
// NIP-71 standard field: bits/sec as integer, positive
|
|
||||||
if value.parse::<u64>().map_or(true, |b| b == 0) {
|
|
||||||
return Err("imeta bitrate must be a positive integer".into());
|
return Err("imeta bitrate must be a positive integer".into());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
"image" => {
|
"image" => {
|
||||||
// NIP-71 poster frame — must be a local media URL with an image extension.
|
// NIP-71 poster frame — must be a local media URL with an image extension.
|
||||||
// Poster frames are independent blobs, NOT thumbnails.
|
// Poster frames are independent blobs, NOT thumbnails.
|
||||||
|
|||||||
@@ -703,16 +703,12 @@ fn validate_diff_event(event: &Event) -> Result<(), String> {
|
|||||||
return Err("parent-commit SHA must be at least 7 hex characters".to_string());
|
return Err("parent-commit SHA must be at least 7 hex characters".to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"branch" => {
|
"branch" if (parts.len() < 3 || parts[1].is_empty() || parts[2].is_empty()) => {
|
||||||
if parts.len() < 3 || parts[1].is_empty() || parts[2].is_empty() {
|
|
||||||
return Err("branch tag requires both source and target".to_string());
|
return Err("branch tag requires both source and target".to_string());
|
||||||
}
|
}
|
||||||
}
|
"pr" if parts[1].parse::<u32>().map(|n| n == 0).unwrap_or(true) => {
|
||||||
"pr" => {
|
|
||||||
if parts[1].parse::<u32>().map(|n| n == 0).unwrap_or(true) {
|
|
||||||
return Err("pr number must be a positive integer".to_string());
|
return Err("pr number must be a positive integer".to_string());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ pub fn sync_managed_agent_processes(
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
if process_is_running(pid) {
|
if process_is_running(pid) && process_belongs_to_us(pid) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,7 +601,7 @@ pub fn start_managed_agent_process(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(pid) = record.runtime_pid {
|
if let Some(pid) = record.runtime_pid {
|
||||||
if process_is_running(pid) {
|
if process_is_running(pid) && process_belongs_to_us(pid) {
|
||||||
record.updated_at = now_iso();
|
record.updated_at = now_iso();
|
||||||
record.last_error = None;
|
record.last_error = None;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
@@ -186,6 +186,24 @@ export function ManagedAgentsSection({
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
|
{!isLoading && stoppedCount > 0 ? (
|
||||||
|
<div className="flex items-center justify-between rounded-xl border border-border/60 bg-muted/30 px-4 py-2.5">
|
||||||
|
<p className="text-sm text-muted-foreground">
|
||||||
|
{stoppedCount} stopped {stoppedCount === 1 ? "agent" : "agents"}
|
||||||
|
</p>
|
||||||
|
<Button
|
||||||
|
className="text-destructive"
|
||||||
|
disabled={isActionPending}
|
||||||
|
onClick={onBulkRemoveStopped}
|
||||||
|
size="sm"
|
||||||
|
variant="ghost"
|
||||||
|
>
|
||||||
|
<Trash2 className="mr-1.5 h-3.5 w-3.5" />
|
||||||
|
Remove stopped
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
|
||||||
{error ? (
|
{error ? (
|
||||||
<p className="rounded-2xl border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive">
|
<p className="rounded-2xl border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive">
|
||||||
{error.message}
|
{error.message}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "stable"
|
channel = "1.95.0"
|
||||||
profile = "default"
|
profile = "default"
|
||||||
|
|||||||
Reference in New Issue
Block a user