Simplify Go installation and support standard OpenCode releases

This commit is contained in:
2026-10-08 23:17:38 +01:00
parent 0f30a001c2
commit accbe63e39
101 changed files with 1331 additions and 682 deletions
+8 -8
View File
@@ -10,9 +10,9 @@ import (
"sync"
"time"
"pipelines/internal/pipeline"
"pipelines/internal/protocol"
"pipelines/internal/stage"
"git.a-wan.net/alan/pipelines/internal/pipeline"
"git.a-wan.net/alan/pipelines/internal/protocol"
"git.a-wan.net/alan/pipelines/internal/stage"
)
type runner struct {
@@ -27,16 +27,16 @@ type runner struct {
}
func newRunner(ctx context.Context, s *pipeline.Store) (*runner, error) {
sessions, err := s.ActiveAgentSessions(ctx)
sessions, err := s.ActiveSessionOwners(ctx)
if err != nil {
return nil, err
}
for _, id := range sessions {
for _, owner := range sessions {
stop, cancel := context.WithTimeout(ctx, 20*time.Second)
err := (stage.OpenCodeClient{}).Interrupt(stop, id)
err := (stage.OpenCodeClient{Backend: owner.Backend, Directory: owner.Directory, Reference: owner.Reference}).Interrupt(stop, owner.ID)
cancel()
if err != nil {
return nil, fmt.Errorf("cannot interrupt previously active agent %s: %w", id, err)
return nil, fmt.Errorf("cannot interrupt previously active agent %s: %w", owner.ID, err)
}
}
if err := s.RecoverRuns(ctx); err != nil {
@@ -241,7 +241,7 @@ func (r *runner) run(ctx context.Context, id int64, d *protocol.PipelineDetail,
client.OnSession = func(session string, active bool) error {
c, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
return r.store.RunSession(c, id, sequence, session, active)
return r.store.RunSession(c, id, sequence, session, active, client.Backend, client.Reference)
}
var result stage.Result
var err error