Add Go worker agent prototype

This commit is contained in:
Emil
2026-08-02 16:27:58 +03:00
parent f20cc7fe00
commit 644c287002
15 changed files with 2012 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
// Command worker-agent is the Go worker agent: a coordinator client that
// executes SDK workloads in a Python subprocess per claimed task.
package main
import (
"log/slog"
"os"
"github.com/emil28092005/SciMesh/coordinator/internal/agent"
)
func main() {
config, err := agent.LoadConfig()
if err != nil {
slog.Error("invalid configuration", "error", err)
os.Exit(2)
}
logger := slog.New(slog.NewTextHandler(os.Stderr, nil))
client := agent.NewClient(config.CoordinatorURL, config.Token, config.RequestTimeout)
runner := agent.NewTaskRunner(config.TaskRunner)
daemon := agent.NewDaemon(config, client, runner, logger)
if err := daemon.RunForever(); err != nil {
logger.Error("agent stopped", "error", err)
os.Exit(1)
}
}