Relay current process output without spool

This commit is contained in:
npc0-hue
2026-08-31 23:35:14 +08:00
parent cde99e19fa
commit c8f5213954
9 changed files with 239 additions and 90 deletions
+3 -8
View File
@@ -66,13 +66,6 @@ func main() {
os.Exit(1)
}
log.Printf("RUN phase=workspace_seed status=ready workspace=%s", diagnosticValue(cfg.WorkspaceRoot))
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=artifact_queue status=opening path=%s", diagnosticValue(cfg.SpoolRoot))
artifactQueue, err := spool.NewArtifactQueue(cfg.SpoolRoot)
if err != nil {
@@ -80,11 +73,13 @@ 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=worker_init status=starting endpoint=%s", diagnosticValue(cfg.RunEndpointID))
worker, err := runruntime.NewWorker(
cfg,
client,
runruntime.WithProcessLogSink(&runruntime.SpoolLogSink{Spool: logSpool}),
runruntime.WithProcessLogSink(liveLogSink),
runruntime.WithLifecycleArtifactHook(&runruntime.QueueArtifactHook{Queue: artifactQueue}),
)
if err != nil {