gw#601: generic worker-activity progress — mint/warmup report liveness, typed activity_failed#348
Merged
Merged
Conversation
…vidence-gated watchdog heartbeat, typed activity_failed; mint/warmup phases (th#929 companion)
PaulFidika
marked this pull request as ready for review
July 20, 2026 09:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion: tensorhub th#929 (hub side: generic stall enforcement — PR cozy-creator/tensorhub#504). Wire names are byte-identical across repos; the canonical proto lives in tensorhub and is mirrored here (
proto/worker_scheduler.proto, pb regenerated).Paul's rulings (2026-07-20): NOT mint-specific — one generic worker-activity contract, self-mint is just one activity kind; detect STALL, not slowness — the watchdog proves liveness, the hub owns termination; a silent death is a bug by contract.
Wire (additive)
WorkerMessage.activity_update = 9:{kind, phase, step/total, monotonic seq, state, error, detail}. Kinds at launch:self_mint_compile,warmup. Model downloads keep their richer ModelEvent byte shape (hub folds them into the same store).Worker
gen_worker/activity.py: process-monotonic seq;begin/runningbracket (COMPLETED on clean exit, FAILED carrying the exception on raise — the typedactivity_failed);watchdogbracket for long wire-silent calls (inductor etc.): background thread heartbeats ~60s ONLY while an evidence counter (default process-CPU seconds) advances — an induced hang stops the beat within one interval. Without a bound transport sink, reports land on the logger (the cozy-local progress UI).self_mint_compilewhencompile=is declared, elsewarmup), begun around_setup_lockedunder the watchdog; phasesload→inductor_compile(pending self-mint) /warmup_forward n/N(per synthesized warmup job) →seal_publish(finalize_self_mint). Sink bound to the transport loop atensure_setup.local_cells._mintruns under the same activity+watchdog bracket — same events, local sink.Tests (
tests/test_activity_gw601.py, real executor code path — no executor mocks)ensure_setup.RuntimeError: induced setup crash.runningbracket reports FAILED with the exception and clears the current activity.🤖 Generated with Claude Code