Skip to content

feat(agents): agent platform — registry, activity hooks, harness allowlist#118

Closed
yyovil wants to merge 1 commit into
aoagents:mainfrom
yyovil:agents/00-platform
Closed

feat(agents): agent platform — registry, activity hooks, harness allowlist#118
yyovil wants to merge 1 commit into
aoagents:mainfrom
yyovil:agents/00-platform

Conversation

@yyovil
Copy link
Copy Markdown
Collaborator

@yyovil yyovil commented Jun 5, 2026

Agent platform (base of a stacked series)

This is the root PR of a stack. It lands the shared platform that every
per-agent adapter plugs into; each subsequent PR in the stack adds one agent
adapter
on top of this.

Wired here for the three already-shipped harnesses — claude-code, codex,
opencode.

What's in it

  • adapters/agent/registry — single source of truth for the shipped
    adapters (Constructors()); the daemon resolves a session's harness through
    it. Adding an agent becomes one line here.
  • adapters/agent/activitydispatch + the ao hooks command — maps an
    agent's native hook callbacks onto AO activity states
    (active/idle/waiting_input/…).
  • claude-code / codex / opencode — emit SessionStart /
    UserPromptSubmit / Stop activity through the dispatcher.
  • HTTP + OpenAPI — report session activity state.
  • db — a single migration that widens sessions.harness to all shipped
    harnesses at once, replacing what was an 18-migration chain where each step
    textually depended on the previous one's output (and silently no-op'd if
    merged out of order). New adapters now need no further migration.
  • domain — harness constants + an --agent alias for ao spawn.

Why a stack

The per-agent adapters are independent packages, but they all register through
the same handful of files (Constructors(), the activity dispatcher, the
harness allowlist). Landing the platform once, then stacking one adapter per PR,
keeps each adapter reviewable in isolation without a tangle of migration-order
and merge hazards.

Testing

go build / go vet / go test ./... green, except the pre-existing
TestSessionStreamsRealZellijPane integration test, which fails only on the
known environmental zellij IPC-socket-path-too-long issue (long macOS $TMPDIR)
— unrelated to this change.

🤖 Generated with Claude Code

…wlist

Introduces the shared platform that per-agent adapters plug into, wired for the
three shipped harnesses (claude-code, codex, opencode):

- adapters/agent/registry: single source of truth for shipped adapters
  (Constructors), consumed by the daemon to resolve a session's harness.
- adapters/agent/activitydispatch + 'ao hooks' command: maps an agent's native
  hook callbacks onto AO activity states (active/idle/waiting/...).
- claudecode/codex/opencode: emit SessionStart/UserPromptSubmit/Stop activity.
- HTTP + OpenAPI: report session activity state.
- db: single migration widening sessions.harness to all shipped harnesses, so
  adding an adapter needs no further migration.
- domain: harness constants + --agent alias for 'ao spawn'.

Adding a new agent is now one adapter package plus a line in Constructors().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yyovil yyovil force-pushed the agents/00-platform branch from c929644 to 31fdf0e Compare June 5, 2026 23:31
@yyovil
Copy link
Copy Markdown
Collaborator Author

yyovil commented Jun 5, 2026

Superseded by #119 — recreating in-upstream so the adapter stack can base off it.

@yyovil yyovil closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant