Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
220fb4a
fix(coordinator): make bootstrap non-blocking
xnoto Mar 3, 2026
7900e58
fix(ci): format watch test for ruff
xnoto Mar 3, 2026
ea532fb
fix(coordinator): bootstrap synchronously and verify readiness
xnoto Mar 3, 2026
07fbe70
fix(coordinator): allow activity-based bootstrap readiness
xnoto Mar 3, 2026
1558127
fix(coordinator): allow best-effort startup on bootstrap timeout
xnoto Mar 3, 2026
1ef1469
fix(daemon): kill stray hub server on startup failure
xnoto Mar 3, 2026
0ffeca1
fix(hub): remove unsupported serve model flag
xnoto Mar 3, 2026
45aaddc
fix(daemon): poll sessions across all projects including global
xnoto Mar 5, 2026
a462aa8
fix(daemon): remove COORDINATOR_MODEL and use hub server config for d…
xnoto Mar 7, 2026
48486db
fix(tests): remove COORDINATOR_MODEL reference and fix signal import
xnoto Mar 7, 2026
bd4a446
fix(docs): remove deprecated COORDINATOR_MODEL from README and fix te…
xnoto Mar 7, 2026
f2896bd
fix(daemon): use SQLite for session discovery, remove XDG_CONFIG_HOME…
xnoto Mar 7, 2026
2e26116
chore: remove dead _parse_session_id_from_json_output and add SQLite …
xnoto Mar 7, 2026
24a769d
docs(contributing): add integration testing guide and update architec…
xnoto Mar 7, 2026
fa7e827
docs(readme): simplify README, remove LLM bloat
xnoto Mar 7, 2026
01f69b7
fix(watch,daemon): show archived messages in dashboard and clean stal…
xnoto Mar 7, 2026
1133697
fix(daemon): only orient sessions created after daemon start
xnoto Mar 7, 2026
027e9f7
fix(daemon): purge stale agents on startup and scope message delivery
xnoto Mar 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 3 additions & 47 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -114,47 +114,7 @@
"filename": ".github/workflows/release-please.yml",
"hashed_secret": "3e26d6750975d678acb8fa35a0f69237881576b0",
"is_verified": false,
"line_number": 34,
"is_added": false,
"is_removed": false
}
],
"src/opencode_agent_hub/daemon.py": [
{
"type": "Secret Keyword",
"filename": "src/opencode_agent_hub/daemon.py",
"hashed_secret": "c41e49700c9c5e1766fc3ef8e8f36b0ce92326ff",
"is_verified": false,
"line_number": 435,
"is_added": false,
"is_removed": false
},
{
"type": "Secret Keyword",
"filename": "src/opencode_agent_hub/daemon.py",
"hashed_secret": "01316b806f30c57b1da2a281f514ba0e77e1c43e",
"is_verified": false,
"line_number": 436,
"is_added": false,
"is_removed": false
},
{
"type": "Secret Keyword",
"filename": "src/opencode_agent_hub/daemon.py",
"hashed_secret": "6267a72c61ecec32905226262bacc75cf6a91301",
"is_verified": false,
"line_number": 437,
"is_added": false,
"is_removed": false
},
{
"type": "Secret Keyword",
"filename": "src/opencode_agent_hub/daemon.py",
"hashed_secret": "2b48a76df3b7c706ddfe518edc5fdae481feb0c2",
"is_verified": false,
"line_number": 438,
"is_added": false,
"is_removed": false
"line_number": 34
}
],
"src/opencode_agent_hub/watch.py": [
Expand All @@ -163,18 +123,14 @@
"filename": "src/opencode_agent_hub/watch.py",
"hashed_secret": "cf0c39294e269cafab08ee2d0702885981e99951",
"is_verified": false,
"line_number": 284,
"is_added": false,
"is_removed": false
"line_number": 284
},
{
"type": "Secret Keyword",
"filename": "src/opencode_agent_hub/watch.py",
"hashed_secret": "64e35dc98f89e69055d58e1c89d11ec2ba50dbb8",
"is_verified": false,
"line_number": 285,
"is_added": false,
"is_removed": false
"line_number": 285
}
]
},
Expand Down
48 changes: 43 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,15 @@ Releases are automated via [release-please](https://github.com/google-github-act
├── AGENTS.md # Optional coordinator instructions override
└── COORDINATOR.md # Alias for AGENTS.md

Daemon watches these directories and:
1. Detects new messages via watchdog
2. Looks up target agent's OpenCode session (by session ID, not directory)
3. Injects message via OpenCode HTTP API
4. Marks message as delivered
~/.local/share/opencode/
└── opencode.db # Shared SQLite database (all sessions)

Daemon:
1. Polls SQLite DB for new sessions (primary discovery mechanism)
2. Detects new messages via watchdog on ~/.agent-hub/messages/
3. Looks up target agent's OpenCode session (by session ID, not directory)
4. Injects message via OpenCode HTTP API (prompt_async)
5. Marks message as delivered
```

### Session-Based Agent Identity
Expand All @@ -124,6 +128,8 @@ Multiple OpenCode sessions in the same directory each get a unique agent identit

## Testing

### Unit Tests

Tests use pytest:
```bash
uv run pytest -v
Expand All @@ -133,3 +139,35 @@ For coverage:
```bash
uv run pytest --cov=opencode_agent_hub --cov-report=html
```

### Integration Testing (Manual)

To test session discovery, orientation, and multi-agent coordination end-to-end,
you need to run the daemon and watch dashboard, then spin up TUI sessions.

**Terminal 1 — Daemon:**
```bash
uv run agent-hub-daemon
```

**Terminal 2 — Watch dashboard:**
```bash
uv run agent-hub-watch
```

**Terminal 3+ — TUI sessions:**
```bash
opencode # default model
opencode --agent kimi # specific agent/model
```

**What to verify:**
- The daemon detects new TUI sessions within ~5 seconds (watch the daemon logs)
- New sessions receive an orientation message from the coordinator
- The watch dashboard shows the session and its agent identity
- Messages sent between agents are delivered (check `~/.agent-hub/messages/`)

The daemon discovers sessions by querying OpenCode's shared SQLite database at
`~/.local/share/opencode/opencode.db`. All OpenCode processes (TUI and serve)
share this database, so the daemon sees every session regardless of how it was
started.
588 changes: 77 additions & 511 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions contrib/coordinator/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ You are the **coordinator** for a multi-agent system. Your job is to facilitate

Your value is making agents aware of each other. Once they're talking directly, **stay out of it**.

## Session Mode

- This session is non-interactive.
- Never ask the human user anything.
- Never use the `question` tool.

## Your Responsibilities

1. **Capture tasks** - When notified of a new agent, ask what they're working on (ONE message)
Expand Down
1 change: 1 addition & 0 deletions contrib/coordinator/opencode.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "https://opencode.ai/config.json",
"model": "opencode/minimax-m2.5-free",
"permission": [
{"permission": "agent-hub_*", "pattern": "*", "action": "allow"},
{"permission": "question", "pattern": "agent-hub*", "action": "allow"},
Expand Down
Loading
Loading