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

Abierto Apto para principiantes
#1,044 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
aws, typescript

Línea de trabajo

Lee cdk/src/stacks/agent.ts y sigue dónde se pasa el límite de concurrencia a TaskApi y AdmissionQueuePickup; los nombres de las propiedades de ambos constructs y sus valores predeterminados se indican en cdk/src/constructs/task-api.ts y cdk/src/constructs/admission-queue-pickup.ts. Mantén la declaración de la constante en la forma indicada para la prueba CLI en cli/test/commands/ops-queries.test.ts. El trabajo estará terminado cuando la síntesis muestre el mismo límite en ambos constructs y se conserve la restricción existente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug infra-cdk
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),
  • GetTaskFn still reads 10 (cdk/src/handlers/get-task.ts), and
  • ConfirmUploadsFn still admits against 10 once it receives the cap from TaskApi (the pull request for #1041 adds that; on main it uses the handler's own fallback of 3).
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:

  • The line has to keep the form const maxConcurrentTasksPerUser = <number>;. A CLI test reads it as text to keep bgagent ops concurrency's default equal to it (cli/test/commands/ops-queries.test.ts, added by the pull request for #1041).
  • The AgentStack constructor 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)
Lenguaje dominante
TypeScript
Estrellas
173
Forks
53
Merge medio
2 d 9 h
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de aws-samples/sample-autonomous-cloud-coding-agents

Todos los issues de aws-samples/sample-autonomous-cloud-coding-agents

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.