test(agents): port runAgentTask import-boundary test from closed #530 #535
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#535
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 a CI-running test that asserts
runAgentTaskis only imported frominfrastructure/agents/, so that the@internalmarker is enforced and accidental re-leaks fail fast on every push.Why
Issue #519 closed via #533 (route dispatch through
AgentDispatchPort). The parallel PR #530 (closed as duplicate on 2026-04-28) carried a novelrun-agent-task-boundary.test.tsthat did not land in main. The closing comment promised a follow-up — this is it.Without this test, a future refactor can re-import
runAgentTaskfrom any module without anyone noticing.Acceptance criteria
apps/server/src/infrastructure/agents/run-agent-task-boundary.test.ts(port verbatim fromdev/519commit3ede225)*.tsfile underapps/server/src/(excluding*.test.tsandnode_modules)infrastructure/agents/matchesimport\s*\{[^}]*\brunAgentTask\b[^}]*\}\s*from\s*['"][^'"]*agent-runner['"]bun test apps/server/src/infrastructure/agents/run-agent-task-boundary.test.tspasses (1 test)just qacleanOut of scope
@internalsymbolsbun testinvocationReferences
dev/519, commit3ede225)8cd16f0)3ede225/apps/server/src/infrastructure/agents/run-agent-task-boundary.test.ts