From 386a295f20e224f159cdcba934a8c213e498fffa Mon Sep 17 00:00:00 2001 From: npc0-hue Date: Wed, 2 Sep 2026 10:27:45 +0800 Subject: [PATCH] Use durable log spool in worker entrypoint --- cmd/run/main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/run/main.go b/cmd/run/main.go index 7a28967..f0a0387 100644 --- a/cmd/run/main.go +++ b/cmd/run/main.go @@ -73,13 +73,18 @@ func main() { os.Exit(1) } log.Printf("RUN phase=artifact_queue status=ready path=%s", diagnosticValue(cfg.SpoolRoot)) - liveLogSink := runruntime.NewLiveLogSink(client) - defer liveLogSink.Close() + log.Printf("RUN phase=log_spool status=opening path=%s", diagnosticValue(cfg.SpoolRoot)) + logSpool, err := spool.NewLogSpool(cfg.SpoolRoot) + if err != nil { + fmt.Fprintf(os.Stderr, "initialize log spool: %v\n", err) + os.Exit(1) + } + log.Printf("RUN phase=log_spool status=ready path=%s", diagnosticValue(cfg.SpoolRoot)) log.Printf("RUN phase=worker_init status=starting endpoint=%s", diagnosticValue(cfg.RunEndpointID)) worker, err := runruntime.NewWorker( cfg, client, - runruntime.WithProcessLogSink(liveLogSink), + runruntime.WithProcessLogSink(&runruntime.SpoolLogSink{Spool: logSpool}), runruntime.WithLifecycleArtifactHook(&runruntime.QueueArtifactHook{Queue: artifactQueue}), ) if err != nil {