O2: gate retry with failure log (#10)

This commit was merged in pull request #10.
This commit is contained in:
hermes committed 2026-11-12 23:21:21 +00:00
1 parent fb434c670c
commit 2f79b69977
4 files changed
+127 -41

No files matched your search

+10 -3
View File
@@ -7,11 +7,11 @@ use std::path::PathBuf;
#[derive(Deserialize, Debug, Default, Clone)]
#[serde(deny_unknown_fields)]
pub struct Budget {
/// Wall clock limit for the hx run (not the gate). Default 30 min.
/// Wall clock limit per hx attempt (not the gate). Default 30 min.
pub wall_secs: Option<u64>,
/// Max `turn_start` events before hx is killed.
/// Max `turn_start` events over the whole run (all attempts) before hx is killed.
pub max_turns: Option<u64>,
/// Max input+output tokens, summed over `stream/done` events.
/// Max input+output tokens over the whole run, summed over `stream/done` events.
pub max_tokens: Option<u64>,
}
@@ -31,10 +31,17 @@ pub struct Profile {
pub yolo: bool,
/// Shell command run in the worktree after hx; exit 0 = pass. None = no gate.
pub gate: Option<String>,
/// Extra hx attempts after a red gate (default 2). 0 = fail straight to needs-human.
#[serde(default = "default_retries")]
pub max_retries: u32,
#[serde(default)]
pub budget: Budget,
}
fn default_retries() -> u32 {
2
}
fn default_hx() -> String {
"hx".into()
}