feat(agents): per-call forge-token override in AgentDispatchPort.dispatch() #521
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#521
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 caller dispatching against a repo whose token has just rotated, I want to pass the token explicitly in
AgentDispatchRequest, so that dispatch does not rely on a possibly-staleconfig.tokens[forge]lookup.Why
Audit (2026-04-28):
agent-runner.ts:666–672resolves the forge token from the loaded config snapshot at dispatch time. Token rotation requires a config reload; in-flight dispatches between rotation and reload pick up a stale token and fail forge calls.Acceptance criteria
AgentDispatchRequest.forgeToken?: stringoverrides the registry default when providedDefaultAgentDispatchpasses the override to bothMcpRegistryPort.serversFor()and the per-taskForgePortfactoryTests
Out of scope
References
apps/server/src/infrastructure/agents/agent-runner.ts:666–672