Skip to content

fix(compose): remove the gateway development CPU quota - #1601

Merged
Cedric Vidal (cedricvidal) merged 4 commits into
mainfrom
cedricvidal-reproduce-copilot-stack-issue
Nov 5, 2026
Merged

Cedric Vidal (cedricvidal) merged 4 commits into
mainfrom
cedricvidal-reproduce-copilot-stack-issue

Conversation

@cedricvidal

@cedricvidal Cedric Vidal (cedricvidal) commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reproduced problem

On a fresh Docker or Podman development start, the gateway performs a cold Rust/Cargo compilation inside the development container. The development overlay inherited the production gateway limit of cpus: "0.5", so rustc was heavily throttled during the cold build. The gateway did not become healthy in time, coder-acp-copilot remained blocked on condition: service_healthy, and submitted runs remained pending because the worker never reached queue processing.

Root cause and fix

The production CPU quota was appropriate for the already-built runtime image, but not for the development image that compiles the gateway under cargo watch. This change explicitly removes only that inherited development CPU quota with:

cpus: !reset null

The effective development configuration still:

  • limits gateway memory to 2 GiB;
  • retains the 600-second (10m0s) first-start health grace;
  • preserves the existing gateway healthcheck;
  • persists /build/target in the gateway_target named volume so later starts reuse Cargo output; and
  • preserves the Copilot worker's gateway dependency with condition: service_healthy.

This lets the cold compilation use the CPUs assigned to Docker or the Podman VM while keeping memory bounded and retaining a generous readiness window. Once the gateway becomes healthy, the worker starts normally and can process queued runs.

Focused Compose regression coverage asserts the fully merged base + development configuration rather than only the override source. Contributor and gateway architecture documentation now describe the cold-start behavior and readiness expectations.

Scope and stack context

The behavior change is limited to the Docker development gateway overlay. Production Compose/Kubernetes gateway CPU and memory limits, gateway routing, health semantics, the Copilot worker dependency, Portal behavior, CLI behavior, APIs, data models, and dependencies are unchanged.

This PR is the gateway-behavior layer in the native stack. Merge commit e5b43c0aae8eea21e40bd782cf7cbf74886ec6ee later incorporated prerequisite PR #1609 (a73e0ec5715a74aa4f53c4cab6c3227dbf60ac57) only to unblock stack-wide license-header CI. Those website CSS header changes do not participate in or alter the gateway fix.

Demos

N/A — Docker development configuration only; no Portal or CLI UI change.

Before

N/A — the failure is a development-stack cold-build/readiness condition rather than a user-visible UI flow.

After

N/A — the effective Compose configuration and worker readiness contract are covered by the focused regression test below.

Testing

  • PASS — pnpm exec vitest run scripts/docker-compose.test.ts --reporter=default: 1 test file passed, 1/1 test passed. The test renders the merged Compose model and verifies no gateway cpus value, 2 GiB memory, 10m0s health start period, the unchanged healthcheck command, the gateway_target mount, and coder-acp-copilot → gateway service_healthy dependency.
  • PASS — GITHUB_TOKEN="${GITHUB_TOKEN:-}" docker compose -f docker-compose.yml -f docker-compose.dev.yml --profile copilot config --format json: merged configuration reported cpus absent, mem_limit: "2147483648", start_period: "10m0s", the existing wget -qO- http://127.0.0.1:18000/health || exit 1 healthcheck, gateway_target at /build/target, and worker dependency condition service_healthy.
  • PASS — pnpm headers:check: all 965 in-scope files have the required license header after the prerequisite fix(website): add missing license headers #1609 hygiene merge.
  • PASS — git diff --check 05d9435005711a96c63be162044854870e77c242..HEAD: no whitespace errors.
  • PASS — final-base CI run 41752516913 at head e5b43c0aae8eea21e40bd782cf7cbf74886ec6ee: License Headers, Third-party NOTICE, Unit Tests (22), Lint Code, Build Applications, CLI Bundle Integration Tests, and CI Summary all succeeded. Secret Scan, PR labeling, Pages build, gitleaks, and CLA also succeeded; path-filtered integration, gateway, Windows-worker, and LLM-eval jobs were skipped as expected.

Documentation and compatibility

Updated CONTRIBUTING.md and docs/architecture/ai-gateway.md with the development gateway cold-build resource and readiness behavior.

This is a non-breaking Docker development configuration change. Production gateway limits and deployment behavior are unchanged. There are no API, CLI, Portal, database, migration, dependency, or data compatibility impacts. The development overlay requires a Docker Compose version that supports the !reset merge tag; the repository's existing Compose Watch workflow already requires a modern Compose release.

Checklist

  • N/A — If Portal features changed, keep CLI capabilities in sync.
  • N/A — If Portal components changed, update their Storybook stories.
  • N/A — If database changes require a migration, include up() / down() and keep it CosmosDB-compatible.
  • N/A — If dependencies changed, update the lockfile and regenerate NOTICE / NOTICE-REVIEW.txt with pnpm notice as needed.
  • N/A — Video showing the behavior before the suggested change.
  • N/A — Video showing the behavior after the suggested change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added type: documentation Documentation additions, corrections, and improvements. area: cicd Build, test, release, and deployment pipelines. area: infrastructure Cloud resources, hosting, networking, and shared infrastructure. language: javascript Work involving JavaScript code, tooling, or dependencies. topic: testing Test coverage, test infrastructure, and validation quality. labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #441

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3227 3227 0 0 0 0 0 1m30s

🎉 All tests passed!

Github Test Reporter

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the topic: ui Portal, visual presentation, layout, and interface components. label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #451

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3227 3227 0 0 0 0 0 1m0s

🎉 All tests passed!

Github Test Reporter

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #476

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3227 3227 0 0 0 0 0 1m10s

🎉 All tests passed!

Github Test Reporter

@cedricvidal
Cedric Vidal (cedricvidal) marked this pull request as ready for review November 5, 2026 00:37
@cedricvidal
Cedric Vidal (cedricvidal) merged commit 8efc058 into main Nov 5, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cicd Build, test, release, and deployment pipelines. area: infrastructure Cloud resources, hosting, networking, and shared infrastructure. language: javascript Work involving JavaScript code, tooling, or dependencies. topic: testing Test coverage, test infrastructure, and validation quality. topic: ui Portal, visual presentation, layout, and interface components. type: documentation Documentation additions, corrections, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants