Skip to content

Commit 311082f

Browse files
feat(examples): configurable crash demo timing via CRASH_DEMO_DELAY
1 parent 82119bd commit 311082f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

examples/_crash_work.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
DIM = "\033[2m"
1919
RESET = "\033[0m"
2020

21+
# Step delay. Default fast; set CRASH_DEMO_DELAY=1.0 for screen captures.
22+
_DELAY = float(os.environ.get("CRASH_DEMO_DELAY", "0.2"))
23+
2124

2225
def main() -> None:
2326
agent = agentkeeper.create(agent_id="dev-agent", provider="mock")
@@ -34,11 +37,11 @@ def main() -> None:
3437
print(f"{DIM} t+0.0s agent booted, identity set{RESET}")
3538
agent.fact("repo: thinklanceai/auth-service", importance=0.8)
3639
agent.fact("goal: migrate JWT middleware to RS256", importance=0.95)
37-
time.sleep(0.2)
40+
time.sleep(_DELAY)
3841
print(f"{DIM} t+0.2s analysed codebase, opened auth/middleware.py{RESET}")
3942
agent.fact("decision: rotate signing keys via JWKS endpoint", importance=0.9)
4043
agent.event("started editing auth/middleware.py", when="2026-05-24")
41-
time.sleep(0.2)
44+
time.sleep(_DELAY)
4245
print(f"{DIM} t+0.4s wrote 1st half of the migration{RESET}")
4346

4447
execution_state = {
@@ -69,6 +72,7 @@ def main() -> None:
6972
f"facts={snap.meta.fact_count} exec_state=yes{RESET}"
7073
)
7174
print(f"{DIM} t+0.6s … still working when the process is killed …{RESET}")
75+
time.sleep(_DELAY * 2)
7276

7377
# Hard kill: no atexit, no flush, no graceful save. Whatever wasn't
7478
# already on disk is lost forever.

0 commit comments

Comments
 (0)