v0.144.1 code: the wrapper survives a dead reader (BrokenPipe) so a killed pass still keeps its report; the agent looks for kept copies every 5 min (R-868, measured live)
gates / gates (push) Successful in 20s
gates / gates (push) Successful in 20s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
+13
-2
@@ -263,7 +263,14 @@ class Runner:
|
||||
os.replace(tmp, NONCE_FILE)
|
||||
|
||||
def log(self, line):
|
||||
print(line, file=sys.stderr, flush=True)
|
||||
# R-868 (v0.144.1): the agent that reads stderr may be GONE (killed mid-pass, measured live on demo-hp
|
||||
# 2026-10-05): the write then raises BrokenPipeError, and v0.144.0 died right there — after apt had installed
|
||||
# everything, before the report copy was saved. A dead reader must never stop the pass; the journal still
|
||||
# gets every line. Pinned by AgentDiesMidPass.
|
||||
try:
|
||||
print(line, file=sys.stderr, flush=True)
|
||||
except OSError:
|
||||
pass
|
||||
try:
|
||||
subprocess.run(["logger", "-t", "felhom-os-apply", line], timeout=10)
|
||||
except Exception:
|
||||
@@ -1453,7 +1460,11 @@ def main(argv, runner=None, environ=None):
|
||||
r.save_report(argv[2], a.report)
|
||||
except Exception as e:
|
||||
r.log(f"os-apply: the report copy could not be saved (the run is unaffected): {e}")
|
||||
print("OSAPPLY-REPORT " + json.dumps(a.report, sort_keys=True))
|
||||
try:
|
||||
print("OSAPPLY-REPORT " + json.dumps(a.report, sort_keys=True), flush=True)
|
||||
except OSError:
|
||||
# R-868: nobody reads stdout any more (the agent was killed); the copy above carries the report.
|
||||
sys.stdout = open(os.devnull, "w")
|
||||
return rc
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user