Skip to content

Commit b6b36d7

Browse files
yyovilclaude
andcommitted
Merge main into codex/agents-plugin
Re-integrate the agent-adapter layer onto main's rewritten session lane. main (#62/#66/#67/#68/#69) moved the session manager into session_manager plus a service layer, reworked the domain (Activity, IsTerminated), and removed the tmux runtime. This merge: - Keeps the rich, hooks-capable ports.Agent (in internal/ports) as the canonical agent contract; session_manager.Manager now resolves a real adapter per session via ports.AgentResolver (from cfg.Harness on Spawn, the stored harness on Restore) and builds RuntimeConfig.Argv. - Drops the tmux runtime; standardizes on zellij. - Re-adds the daemon's per-session agent resolver wiring (buildAgentResolver over the claude-code + codex registry, AO_AGENT default), ready to plug into the httpd session-route slot. go build, go vet, and go test -race are green; the zellij/tmux real integration tests are environment-gated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 parents 85c1ca1 + 3a93e33 commit b6b36d7

180 files changed

Lines changed: 8183 additions & 9194 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ agent-orchestrator.yaml
2828
session-events.jsonl
2929
session-events.jsonl.*
3030

31+
# Agent Orchestrator local session state
32+
.ao/
33+
3134
# Environment
3235
.direnv/
3336
.env

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# agent-orchestrator
22

33
Rewrite of the agent-orchestrator: a long-running Go backend daemon (`backend/`)
4-
paired with an Electron + TypeScript frontend (`frontend/`).
4+
paired with a placeholder Electron + TypeScript frontend shell (`frontend/`).
55

66
See [`docs/`](docs/README.md) for architecture and status — start with the
7-
Lifecycle Manager + Session Manager lane in [`docs/architecture.md`](docs/architecture.md).
7+
Lifecycle Manager + Session Service lane in [`docs/architecture.md`](docs/architecture.md).
88

99
## Backend daemon
1010

@@ -31,8 +31,8 @@ AO_PORT=3019 go run ./cmd/ao start # override per invocation
3131
Health check:
3232

3333
```bash
34-
curl localhost:3001/healthz # {"status":"ok"}
35-
curl localhost:3001/readyz # {"status":"ready"}
34+
curl localhost:3001/healthz # includes status/service/pid
35+
curl localhost:3001/readyz # includes status/service/pid
3636
```
3737

3838
### Configuration (env only)
@@ -47,10 +47,12 @@ is intentionally not env-configurable.
4747
| `AO_REQUEST_TIMEOUT` | `60s` | per-request timeout (Go duration) |
4848
| `AO_SHUTDOWN_TIMEOUT` | `10s` | graceful-shutdown hard cap |
4949
| `AO_RUN_FILE` | `<UserConfigDir>/agent-orchestrator/running.json` | PID + port handshake path |
50+
| `AO_DATA_DIR` | `<UserConfigDir>/agent-orchestrator/data` | SQLite DB, WAL files, and managed state |
5051

5152
### Test
5253

5354
```bash
54-
cd backend
55-
goimports -local github.com/aoagents/agent-orchestrator -l . && go build ./... && go vet ./... && go test -race ./...
55+
npm run lint
56+
# optional deeper backend pass:
57+
cd backend && go test -race ./...
5658
```

backend/cmd/genspec/main.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Command genspec writes the code-first OpenAPI document produced by
2+
// apispec.Build() to disk. It is invoked via `go generate` (see
3+
// internal/httpd/apispec/gen.go); the output openapi.yaml is committed and
4+
// embedded by the apispec package.
5+
package main
6+
7+
import (
8+
"flag"
9+
"log"
10+
"os"
11+
12+
"github.com/aoagents/agent-orchestrator/backend/internal/httpd/apispec/specgen"
13+
)
14+
15+
func main() {
16+
out := flag.String("out", "openapi.yaml", "output path for the generated OpenAPI document")
17+
flag.Parse()
18+
19+
doc, err := specgen.Build()
20+
if err != nil {
21+
log.Fatalf("genspec: build openapi: %v", err)
22+
}
23+
if err := os.WriteFile(*out, doc, 0o600); err != nil {
24+
log.Fatalf("genspec: write %s: %v", *out, err)
25+
}
26+
}

backend/go.mod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ require (
88
github.com/go-chi/chi/v5 v5.1.0
99
github.com/pressly/goose/v3 v3.27.1
1010
github.com/spf13/cobra v1.10.1
11+
github.com/swaggest/jsonschema-go v0.3.79
12+
github.com/swaggest/openapi-go v0.2.61
1113
golang.org/x/sys v0.43.0
1214
gopkg.in/yaml.v3 v3.0.1
1315
modernc.org/sqlite v1.51.0
@@ -23,8 +25,10 @@ require (
2325
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
2426
github.com/sethvargo/go-retry v0.3.0 // indirect
2527
github.com/spf13/pflag v1.0.9 // indirect
28+
github.com/swaggest/refl v1.4.0 // indirect
2629
go.uber.org/multierr v1.11.0 // indirect
2730
golang.org/x/sync v0.20.0 // indirect
31+
gopkg.in/yaml.v2 v2.4.0 // indirect
2832
modernc.org/libc v1.72.3 // indirect
2933
modernc.org/mathutil v1.7.1 // indirect
3034
modernc.org/memory v1.11.0 // indirect

backend/go.sum

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
github.com/bool64/dev v0.2.43 h1:yQ7qiZVef6WtCl2vDYU0Y+qSq+0aBrQzY8KXkklk9cQ=
2+
github.com/bool64/dev v0.2.43/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
3+
github.com/bool64/shared v0.1.5 h1:fp3eUhBsrSjNCQPcSdQqZxxh9bBwrYiZ+zOKFkM0/2E=
4+
github.com/bool64/shared v0.1.5/go.mod h1:081yz68YC9jeFB3+Bbmno2RFWvGKv1lPKkMP6MHJlPs=
15
github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g=
26
github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
37
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
@@ -15,6 +19,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
1519
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
1620
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
1721
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
22+
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
23+
github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE=
1824
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
1925
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
2026
github.com/mattn/go-isatty v0.0.21 h1:xYae+lCNBP7QuW4PUnNG61ffM4hVIfm+zUzDuSzYLGs=
@@ -30,6 +36,8 @@ github.com/pressly/goose/v3 v3.27.1/go.mod h1:maruOxsPnIG2yHHyo8UqKWXYKFcH7Q76cs
3036
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
3137
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
3238
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
39+
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
40+
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
3341
github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=
3442
github.com/sethvargo/go-retry v0.3.0/go.mod h1:mNX17F0C/HguQMyMyJxcnU471gOZGxCLyYaFyAZraas=
3543
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
@@ -38,6 +46,18 @@ github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
3846
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
3947
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
4048
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
49+
github.com/swaggest/assertjson v1.9.0 h1:dKu0BfJkIxv/xe//mkCrK5yZbs79jL7OVf9Ija7o2xQ=
50+
github.com/swaggest/assertjson v1.9.0/go.mod h1:b+ZKX2VRiUjxfUIal0HDN85W0nHPAYUbYH5WkkSsFsU=
51+
github.com/swaggest/jsonschema-go v0.3.79 h1:0TOShCbAJ9Xjt1e2W83l+QtMQSG2pbun2EkiYTyafCs=
52+
github.com/swaggest/jsonschema-go v0.3.79/go.mod h1:GqVmJ+XNLeUHhFIhHNKc+C68euxfrl3a3aoZH4vTRl0=
53+
github.com/swaggest/openapi-go v0.2.61 h1:psc+LE7pWhEjmJpmkti9tUmBPkkobdUNflBf5Ps6JSc=
54+
github.com/swaggest/openapi-go v0.2.61/go.mod h1:786CwSwleh1IorB0nfwYGESWf83JgQh6fBc1PeJe4Iw=
55+
github.com/swaggest/refl v1.4.0 h1:CftOSdTqRqs100xpFOT/Rifss5xBV/CT0S/FN60Xe9k=
56+
github.com/swaggest/refl v1.4.0/go.mod h1:4uUVFVfPJ0NSX9FPwMPspeHos9wPFlCMGoPRllUbpvA=
57+
github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
58+
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
59+
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
60+
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
4161
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
4262
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
4363
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
@@ -50,6 +70,8 @@ golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
5070
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
5171
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
5272
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
73+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
74+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
5375
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
5476
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
5577
modernc.org/cc/v4 v4.28.2 h1:3tQ0lf2ADtoby2EtSP+J7IE2SHwEJdP8ioR59wx7XpY=

backend/internal/adapters/runtime/tmux/commands.go

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)