feat(agents): finish ClaudeAgentPort migration — eliminate SDK leaks in agent-runner #517
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#517
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a maintainer, I want all SDK calls and types to live behind
ClaudeAgentPort/SdkClaudeAgent, so thatagent-runner.tsconsumes only domain types and the SDK can be swapped or mocked at the boundary.Acceptance criteria
Migration
agent-runner.ts:715–780: replace directquery({...})call withclaudeAgent.run(request)via injectedClaudeAgentPortagent-runner.ts:24: dropSDKMessageimportagent-runner.ts:679: PR-extract regex moved into adapter (or into a domain helper if used elsewhere)domain/foreman/foreman.ts: stop buildingOptionsdirectly — useClaudeAgentPortlike containerised agents@anthropic-ai/claude-agent-sdkimport outsideinfrastructure/agents/sdk-adapter.tsBehavioural parity
/task/:id/steerpreserved (port exposes a write-side handle)agent-runner.ts:780–814) still firesTests
Out of scope
References
apps/server/src/domain/agent/claude-port.tsapps/server/src/infrastructure/agents/sdk-adapter.tsapps/server/src/infrastructure/agents/agent-runner.ts