Merge branch 'worktree-agent-a37f45fa108430592'

# Conflicts:
#	internal/server/websocket.go
This commit is contained in:
2026-11-10 01:00:49 +00:00
29 changed files with 1471 additions and 101 deletions
+17 -1
View File
@@ -21,6 +21,7 @@ import (
"git.a-wan.net/alan/pipelines/internal/pipeline"
"git.a-wan.net/alan/pipelines/internal/protocol"
"git.a-wan.net/alan/pipelines/internal/server"
"git.a-wan.net/alan/pipelines/internal/servertoken"
"git.a-wan.net/alan/pipelines/internal/summarise"
)
@@ -39,7 +40,22 @@ func main() {
db := flag.String("db", defaultDB, "SQLite database path (honors XDG_DATA_HOME)")
mdnsOn := flag.Bool("mdns", envEnabled(os.Getenv("PIPELINES_MDNS")), "Advertise the server on the LAN with mDNS/DNS-SD ("+discovery.ServiceType+"); PIPELINES_MDNS=off disables")
mdnsPort := flag.Int("mdns-port", envPort(os.Getenv("PIPELINES_MDNS_PORT")), "Port LAN clients dial: the authenticated web proxy fronting this server (default: the -addr port when it is not loopback)")
tokenFile := flag.String("token-file", os.Getenv(servertoken.EnvKey), "Require the shared secret in this private file on every request (the installer's server-token; PIPELINES_SERVER_TOKEN_FILE)")
flag.Parse()
accessToken := ""
if *tokenFile != "" {
if absolute, absErr := filepath.Abs(*tokenFile); absErr == nil {
*tokenFile = absolute
}
if accessToken, err = servertoken.Read(*tokenFile); err != nil {
log.Fatalf("server token: %v", err)
}
// Stages, chat harnesses and their `pipelines` CLI calls inherit the
// file's location, never the token itself.
_ = os.Setenv(servertoken.EnvKey, *tokenFile)
} else {
log.Printf("no server token configured (-token-file): local clients reach this server without the shared secret")
}
if err := os.MkdirAll(filepath.Dir(*db), 0700); err != nil {
log.Fatal(err)
}
@@ -80,7 +96,7 @@ func main() {
// Each new run gets a bounded one-line title from the configured default
// harness; the summariser falls back to the prompt's first line, so title
// generation never blocks or fails run creation.
options := server.Options{AllowAuthoring: *allowAuthoring, ArtifactsRoot: artifactsRoot, RunTitles: summarise.GenerateTitle, StepVerdicts: summarise.GenerateVerdictReason, VerificationFixtures: server.VerificationFixturesFromEnvironment(os.Getenv), DetachSessions: detach}
options := server.Options{AllowAuthoring: *allowAuthoring, ArtifactsRoot: artifactsRoot, RunTitles: summarise.GenerateTitle, StepVerdicts: summarise.GenerateVerdictReason, VerificationFixtures: server.VerificationFixturesFromEnvironment(os.Getenv), DetachSessions: detach, AccessToken: accessToken}
recorded := ""
if value, err := store.OpenCodeEndpoint(ctx); err != nil {
log.Printf("OpenCode endpoint setting unreadable: %v", err)