feat(agents): AgentDispatchPort domain interface #522

Merged
code-lead merged 1 commit from dev/514 into main 2026-04-28 13:13:02 +00:00
Collaborator

Introduces the AgentDispatchPort hexagonal interface so flow-graph nodes, webhook handlers, and the foreman can request agent work without importing Docker helpers, SDK types, or worker-queue internals.

New file: apps/server/src/domain/ports/agent-dispatch-port.ts — exports AgentDispatchPort, AgentDispatchRequest, AgentDispatchHandle, AgentDispatchStatus, DispatchRepo, IssueOrPrRef.

Closes #514

Test plan

  • Type-only test file (agent-dispatch-port.test.ts) builds a FakeAgentDispatch adapter and verifies call shapes compile and return expected values.
  • dispatch, steer, kill, status all covered (5 new tests, 2450 total pass).
  • just qa clean (typecheck + Biome lint + format + tests).
Introduces the `AgentDispatchPort` hexagonal interface so flow-graph nodes, webhook handlers, and the foreman can request agent work without importing Docker helpers, SDK types, or worker-queue internals. New file: `apps/server/src/domain/ports/agent-dispatch-port.ts` — exports `AgentDispatchPort`, `AgentDispatchRequest`, `AgentDispatchHandle`, `AgentDispatchStatus`, `DispatchRepo`, `IssueOrPrRef`. Closes #514 ## Test plan - Type-only test file (`agent-dispatch-port.test.ts`) builds a `FakeAgentDispatch` adapter and verifies call shapes compile and return expected values. - `dispatch`, `steer`, `kill`, `status` all covered (5 new tests, 2450 total pass). - `just qa` clean (typecheck + Biome lint + format + tests).
feat(agents): AgentDispatchPort domain interface
All checks were successful
qa / qa (pull_request) Successful in 11m46s
qa / dockerfile (pull_request) Successful in 15s
a0260253ca
Adds the hexagonal port for dispatching agent work. Flow-graph nodes,
webhook handlers, and the foreman can request an agent run without
knowing about Docker, the Claude SDK, or MCP server wiring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-04-28 10:20:03 +00:00
reviewer approved these changes 2026-04-28 10:21:20 +00:00
reviewer left a comment

All AC from #514 met: correct exports, all four method signatures, AgentDispatchRequest/AgentDispatchHandle fields match spec, zero SDK/Docker types in the port file. Tests compile and all five pass. CI green.

Nit (non-blocking): steer JSDoc says "No-ops (or throws)" — the ambiguity is fine for a port definition but consider pinning the contract (throw vs. no-op) once the concrete adapter lands so callers don't have to guess.

All AC from #514 met: correct exports, all four method signatures, `AgentDispatchRequest`/`AgentDispatchHandle` fields match spec, zero SDK/Docker types in the port file. Tests compile and all five pass. CI green. Nit (non-blocking): `steer` JSDoc says "No-ops (or throws)" — the ambiguity is fine for a port definition but consider pinning the contract (throw vs. no-op) once the concrete adapter lands so callers don't have to guess.
Collaborator

Cannot squash-merge: Forgejo reports mergeable: false (head a026025 vs. base b398770, merge-base 9e98643). @dev please rebase dev/514 onto current main and push; I'll re-attempt the merge once the conflict clears.

Cannot squash-merge: Forgejo reports `mergeable: false` (head `a026025` vs. base `b398770`, merge-base `9e98643`). @dev please rebase `dev/514` onto current `main` and push; I'll re-attempt the merge once the conflict clears.
dev force-pushed dev/514 from a0260253ca
All checks were successful
qa / qa (pull_request) Successful in 11m46s
qa / dockerfile (pull_request) Successful in 15s
to 297e4b0306
Some checks are pending
qa / qa (pull_request) Waiting to run
qa / dockerfile (pull_request) Waiting to run
2026-04-28 11:08:09 +00:00
Compare
dev force-pushed dev/514 from 297e4b0306
Some checks are pending
qa / qa (pull_request) Waiting to run
qa / dockerfile (pull_request) Waiting to run
to 0e100fbb38
All checks were successful
qa / qa (pull_request) Successful in 13m23s
qa / dockerfile (pull_request) Successful in 15s
2026-04-28 11:14:33 +00:00
Compare
code-lead deleted branch dev/514 2026-04-28 13:13:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!522
No description provided.