Repository navigation
Description
Component
CDK / infrastructure
Describe the bug
AgentStack holds the per-user concurrency cap in one constant, const maxConcurrentTasksPerUser = 10; (cdk/src/stacks/agent.ts), with a comment that says the consumers must never drift. It passes the constant to TaskOrchestrator, LinearIntegration, JiraIntegration and the two orchestration reconcilers.
It does not pass it to TaskApi or to AdmissionQueuePickup. Both constructs accept the property and fall back to a default of their own (props.maxConcurrentTasksPerUser ?? 10, in cdk/src/constructs/task-api.ts and cdk/src/constructs/admission-queue-pickup.ts).
Expected behavior
The one constant reaches every function that reads MAX_CONCURRENT_TASKS_PER_USER.
Current behavior
Nothing is wrong today, because the constant and both defaults are 10. The defect shows when the constant is changed: the orchestrator then admits against the new value, while
- the admission-queue pickup still computes free slots against 10 (
cdk/src/handlers/reconcile-admission-queue.ts), GetTaskFnstill reads 10 (cdk/src/handlers/get-task.ts), andConfirmUploadsFnstill admits against 10 once it receives the cap fromTaskApi(the pull request for feat(testing): emulator-backed integration tier (ADR-013 Tier 2a), with fixes for the defects found #1041 adds that; onmainit uses the handler's own fallback of 3).
Reproduction steps
- Change the constant in
cdk/src/stacks/agent.tsto another value, for example 5. - Synthesize the stack.
MAX_CONCURRENT_TASKS_PER_USERis 5 on the orchestrator and 10 on the functions ofTaskApiandAdmissionQueuePickup.
Possible solution
Declare the constant before the TaskApi construction and pass it to TaskApi and AdmissionQueuePickup.
Two constraints:
- The line has to keep the form
const maxConcurrentTasksPerUser = <number>;. A CLI test reads it as text to keepbgagent ops concurrency's default equal to it (cli/test/commands/ops-queries.test.ts, added by the pull request for feat(testing): emulator-backed integration tier (ADR-013 Tier 2a), with fixes for the defects found #1041). - The
AgentStackconstructor is under a complexity freeze. Passing two properties adds no branch.
Open PR #904 changes the AdmissionQueuePickup line (it moves the construct), so the two changes touch neighbouring lines.
Additional context
Found by the investigation recorded in docs/research/aws-emulator-local-tests.md (pull request for #1041), re-checked on main at 8697c821. It is not fixed by that pull request.
AWS quotas
- I have reviewed the relevant service quotas (or N/A)
Activity
krokoko commentedon Nov 19, 2026
#1052