refactor(agents): migrate flows / foreman / webhook to AgentDispatchPort #519

Closed
opened 2026-04-28 09:25:01 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As a maintainer, I want every dispatch callsite to go through AgentDispatchPort instead of agent-runner.ts directly, so that the agentic abstraction has no leaky paths and runAgentTask() can be deleted (or reduced to an internal helper).

Acceptance criteria

Migration

  • domain/flows/agent-nodes.ts: dispatch via AgentDispatchPort, drop runAgentTask import
  • domain/foreman/foreman.ts: dispatch host-mode foreman via AgentDispatchPort with HostContainerLifecycle adapter
  • http/webhook.ts + downstream handlers: every direct runAgentTask import removed
  • slash-commands.ts + review-loop: same
  • runAgentTask either deleted or marked @internal and only called from DefaultAgentDispatch

Tests

  • All existing webhook + flow + foreman e2e tests pass unchanged
  • New test: assert runAgentTask is not imported outside infrastructure/agents/*

QA

  • just qa clean
  • Manual smoke: open issue with area:dev label → dev agent runs to completion → PR opened

Out of scope

  • Dashboard / /app/monitor/* UI changes
  • New dispatch capabilities (parallelism, priority queues)

References

  • AgentDispatchPort + DefaultAgentDispatch (preceding issues)
## User story As a maintainer, I want every dispatch callsite to go through `AgentDispatchPort` instead of `agent-runner.ts` directly, so that the agentic abstraction has no leaky paths and `runAgentTask()` can be deleted (or reduced to an internal helper). ## Acceptance criteria ### Migration - [ ] `domain/flows/agent-nodes.ts`: dispatch via `AgentDispatchPort`, drop `runAgentTask` import - [ ] `domain/foreman/foreman.ts`: dispatch host-mode foreman via `AgentDispatchPort` with `HostContainerLifecycle` adapter - [ ] `http/webhook.ts` + downstream handlers: every direct `runAgentTask` import removed - [ ] `slash-commands.ts` + review-loop: same - [ ] `runAgentTask` either deleted or marked `@internal` and only called from `DefaultAgentDispatch` ### Tests - [ ] All existing webhook + flow + foreman e2e tests pass unchanged - [ ] New test: assert `runAgentTask` is not imported outside `infrastructure/agents/*` ### QA - [ ] `just qa` clean - [ ] Manual smoke: open issue with `area:dev` label → dev agent runs to completion → PR opened ## Out of scope - Dashboard / `/app/monitor/*` UI changes - New dispatch capabilities (parallelism, priority queues) ## References - AgentDispatchPort + DefaultAgentDispatch (preceding issues)
Sign in to join this conversation.
No project
No assignees
1 participant
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#519
No description provided.