Skip to content

fix(cdk): AgentStack does not pass its per-user cap to TaskApi and AdmissionQueuePickup #1044

Closed

Description

@krokoko

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

Reproduction steps

  1. Change the constant in cdk/src/stacks/agent.ts to another value, for example 5.
  2. Synthesize the stack.
  3. MAX_CONCURRENT_TASKS_PER_USER is 5 on the orchestrator and 10 on the functions of TaskApi and AdmissionQueuePickup.

Possible solution

Declare the constant before the TaskApi construction and pass it to TaskApi and AdmissionQueuePickup.

Two constraints:

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

  1. added
    bugSomething isn't working
    infra-cdkCDK stacks/constructs, bootstrap, deploy topology, tags, IAM wiring, teardown
    on Nov 16, 2026
  2. krokoko commented on Nov 19, 2026

    @krokoko
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    approvedWhen an issue has been approved and readybugSomething isn't workinginfra-cdkCDK stacks/constructs, bootstrap, deploy topology, tags, IAM wiring, teardown

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions