Skip to content

feat(service): the Service keeps one model call in flight by default - #2627

Merged
dan-petty merged 2 commits into
mainfrom
feat/2564-service-model-call-concurrency
Oct 29, 2026
Merged

dan-petty merged 2 commits into
mainfrom
feat/2564-service-model-call-concurrency

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Closes #2564

The roadmap Service runs one lane per repository, and each lane sends its model calls on its own thread. Several lanes send their model calls at the same time. The devops-background tier serves one model call at a time, and the gateway kills a call that waits 1100 s. So a round that starts many lanes at once holds its calls at the gateway, and the held calls time out.

This change adds service.model_call_concurrency (default 1). A shared threading.Semaphore holds the model call slot around the model call in _dispatch_messages, so a lane that cannot take the slot waits in the process, where no stall timer runs. The Service sets the slot from its setting at start; a CLI process sets no limit.

Tests: tests/test_ai_client_network.py (a dispatch call holds the slot; the slot admits only its limit), tests/test_service_limits.py (the Service keeps one model call in flight by default and installs its limit).

fail-to-pass: 4 tests fail on main and pass with the change.

… default

Add service.model_call_concurrency (default 1). A shared threading.Semaphore in the AI client holds the model call slot around _dispatch_messages, so a Service lane that cannot take it waits in the process, not at the gateway. The Service sets the slot from its setting at start; a CLI process sets no limit.

fail-to-pass: 4 tests fail on main and pass with the change (uv run devops ci fail-to-pass --base main).
…e slot tests

Add DEVOPS_CLI_SERVICE_MODEL_CALL_CONCURRENCY to the later-settings list in tests/test_config_declarations.py, which the gate's declaration test compares against. Shorten the sleeps and wait bound of the new slot tests so the suite stays inside the 300 s test budget.
@dan-petty
dan-petty marked this pull request as ready for review October 29, 2026 07:27
@dan-petty
dan-petty merged commit 3fdafbd into main Oct 29, 2026
17 checks passed
@dan-petty
dan-petty deleted the feat/2564-service-model-call-concurrency branch October 29, 2026 12:21
dan-petty pushed a commit that referenced this pull request Oct 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.16.0](v0.15.1...v0.16.0)
(2026-10-29)


### Features

* **service:** the Service keeps one model call in flight by default
([#2627](#2627))
([3fdafbd](3fdafbd))


### Bug Fixes

* **config:** remove the dead cloudflare.access settings
([#2632](#2632))
([dde2f55](dde2f55))
* **roadmap:** read only the last comment as the job record
([#2630](#2630))
([a3eb41f](a3eb41f)),
closes [#2538](#2538)
* **service:** check the GitHub budget for each request
([#2631](#2631))
([99066e7](99066e7))
* **telemetry:** enable remote write 2.0 for created timestamps
([#2629](#2629))
([e84a643](e84a643)),
closes [#2506](#2506)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant