feat: poll forge notifications in agent harness

Closes #27
This commit is contained in:
damocles 2026-05-20 17:54:28 +02:00 committed by Mara
parent a4706d793e
commit cddaacd12f
8 changed files with 913 additions and 9 deletions

View file

@ -296,6 +296,15 @@ fn render_flake(
let upper_key = key.to_ascii_uppercase();
let _ = writeln!(out, " HIVE_CONTEXT_WINDOW_TOKENS_{upper_key} = \"{val}\";");
}
// Forge URL — injected when hive-c0re itself has HIVE_FORGE_URL set
// (the NixOS module derives it from hyperhive.forge.{domain,httpPort}).
// Agents use it in forge_notify to poll Forgejo for PR/review events.
if let Ok(forge_url) = std::env::var("HIVE_FORGE_URL") {
if !forge_url.is_empty() {
let escaped = forge_url.replace('\\', "\\\\").replace('"', "\\\"");
let _ = writeln!(out, " HIVE_FORGE_URL = \"{escaped}\";");
}
}
out.push_str(
r#" HYPERHIVE_STATE_DIR = "/agents/${name}/state";
};