huskies: merge 866
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user