From ffbc8c24963c23b0ce108d4f7563871568825936 Mon Sep 17 00:00:00 2001 From: hel914-total-worker Date: Fri, 30 Oct 2026 10:27:47 +0800 Subject: [PATCH] HEL-914: persona claim lease must cover the 120s generation window (finished result was discarded at the 40s lease check) Co-authored-by: multica-agent --- src/cybergril/life/persona.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cybergril/life/persona.py b/src/cybergril/life/persona.py index 8897bf3..29ebc3d 100644 --- a/src/cybergril/life/persona.py +++ b/src/cybergril/life/persona.py @@ -55,16 +55,19 @@ class Persona: return False now, owner = int(self.clock() * 1000), secrets.token_hex(16) provenance = "backfilled-R2" if backfill else "created-R2" + # HEL-914: the creation generation runs with timeout=120s; the claim lease + # must cover that window or the finished result is discarded (stuck pending). + lease_ms = 150000 with self.store.conn: if self.store.query_one("SELECT id FROM persona_interp"): return True self.store.execute( - "INSERT OR IGNORE INTO persona_job VALUES(1,'pending',?,?,NULL,?)", (owner, now + 40000, provenance) + "INSERT OR IGNORE INTO persona_job VALUES(1,'pending',?,?,NULL,?)", (owner, now + lease_ms, provenance) ) self.store.execute( "UPDATE persona_job SET state='pending',owner=?,lease_until=?,reason=NULL " "WHERE id=1 AND (state='failed' OR (state='pending' AND lease_until