huskies: merge 866

This commit is contained in:
dave
2026-04-29 22:42:59 +00:00
parent a49f668b5a
commit 9a3f60d5d3
19 changed files with 289 additions and 144 deletions
@@ -104,8 +104,6 @@ pub(crate) fn should_block_story(
max_retries: u32,
stage_label: &str,
) -> Option<String> {
use crate::io::story_metadata::write_blocked_in_content;
if max_retries == 0 {
return None;
}
@@ -119,23 +117,16 @@ pub(crate) fn should_block_story(
}
if new_count >= max_retries {
let reason =
format!("Retry limit exceeded ({new_count}/{max_retries}) at {stage_label} stage");
slog_warn!(
"[pipeline] Story '{story_id}' reached retry limit ({new_count}/{max_retries}) \
at {stage_label} stage. Marking as blocked."
);
if let Some(contents) = crate::db::read_content(story_id) {
let blocked = write_blocked_in_content(&contents);
crate::db::write_content(story_id, &blocked);
let stage = crate::pipeline_state::read_typed(story_id)
.ok()
.flatten()
.map(|i| i.stage.dir_name().to_string())
.unwrap_or_else(|| "2_current".to_string());
crate::db::write_item_with_content(story_id, &stage, &blocked);
if let Err(e) = crate::agents::lifecycle::transition_to_blocked(story_id, &reason) {
slog_error!("[pipeline] Failed to transition '{story_id}' to Blocked: {e}");
}
Some(format!(
"Retry limit exceeded ({new_count}/{max_retries}) at {stage_label} stage"
))
Some(reason)
} else {
slog!(
"[pipeline] Story '{story_id}' retry {new_count}/{max_retries} at {stage_label} stage."