feat(agents): per-call forge-token override in AgentDispatchPort.dispatch() #524
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!524
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/521"
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?
Adds
AgentDispatchPort,AgentDispatchRequest(withforgeToken?: string),McpRegistryPort, andDefaultAgentDispatch. WhenforgeTokenis supplied, it overrides the registry default for both MCP server specs and theForgePortfactory —McpRegistryPort.defaultTokenis never read (verified by tracking-getter fake).Closes #521
Test plan
forgeTokenoverride → MCP spec env carries the override token ✓forgeTokenoverride →ForgePortfactory receives the override token ✓forgeTokenoverride →McpRegistryPort.defaultTokengetter is never accessed ✓forgeToken→defaultTokenis read and used for both MCP spec andForgePort✓dispatch()returns thetaskIdfrom the runner ✓Return type declared `calls: number` but the function returned `calls: state` (an object). Aligns the annotation with the actual `{ calls: number }` shape so tsc --noEmit passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>All four AC met, CI green (run #2478).
Nit (not blocking):
??passesforgeToken: ""through as an override — nullish coalescing only short-circuits onnull/undefined, not empty string. Real callers rotating a live token won't send"", so this is harmless in practice, but a one-line comment indispatch()noting that the caller is responsible for supplying a non-empty string would close the ambiguity.