Repository navigation
test(stress): leave a run slot for the reference conversation - #5397
Conversation
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
all-hands-bot
left a comment
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Summary
Single-line change: the stress fixture now caps the server at n_conversations + 1 concurrent runs, leaving a slot for the reference conversation so the 16 concurrent starts are not intermittently rejected with ConversationRunLimitExceeded.
The technical fix is correct and well-scoped. I verified the root cause in the workspace: RunSlot.acquire (openhands-agent-server/openhands/agent_server/event_service.py:133) raises immediately when semaphore.locked(), and the fixture previously set max_concurrent_runs to exactly n. test_run_admission.py independently covers rejection beyond capacity, so raising the fixture's cap does not lose that coverage. The agent-server-stress-tests job passes on this head, and my local runs started all 16 concurrent conversations with no run-limit rejection.
Blocking: required check Validate PR description is failing
Validate PR description fails on this exact head (run 36707537856). The failure is the linked-issue gate in .github/scripts/check_pr_description.py:
Linked issue(s) (#5350) carry neither
ready-for-devnor a pre-rollout creation date.
#5350 is not an issue — it is a closed pull request referenced from the ## Issue Number section (N/A (CI flake introduced with #5350)). The validator extracts that bare #5350 as a linked issue, fetches it, and since it carries no ready-for-dev label the check fails. This is the only failing check on the head, and it makes the PR unmergeable.
Fix: reword the ## Issue Number section so the #5350 reference does not resolve as a linked issue — e.g. N/A, moving the "introduced with #5350" context into ## Why (the validator only scans the ## Issue Number section for bare references), or Fixes #NNN for a real ready-for-dev issue.
Non-blocking observation
test_concurrent_conversations_isolated_and_fast still fails intermittently in my environment on step 5's wall-time budget (concurrent_wall ~0.62s vs ref_wall × 4.0 ~0.6s), independently of this change: the reference run's wall time is too small for a 4x budget to be robust. Not introduced by this PR and not the flake this PR targets, but worth tracking since it will keep this job noisy.
The code change itself is correct. This review is conditional only on the failing required description check being resolved.
🔄 CHANGES REQUESTED
|
@OpenHands fix all CI and issues and rebase main |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
The concurrent-conversations benchmark runs one reference conversation and then n more at once, against a server capped at exactly n runs. The reference run can still hold its permit briefly after reporting FINISHED, so the last concurrent start was intermittently rejected with ConversationRunLimitExceeded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: openhands <openhands@all-hands.dev>
7ddba81 to
ef5b827
Compare
all-hands-bot
left a comment
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Summary
Test-only, single-line change: the stress fixture now caps the server at CONCURRENT_CONVERSATIONS.n_conversations + 1 concurrent runs, leaving one slot for the reference conversation so the 16 concurrent starts are not intermittently rejected with ConversationRunLimitExceeded.
I re-established the current state for this head (ef5b8274):
- The root cause holds in the workspace.
RunSlot.acquire(openhands-agent-server/openhands/agent_server/event_service.py:133) raises as soon assemaphore.locked()(an atomic check-and-acquire on the event loop), so a fixture capped at exactlynleaves no room when the reference run still holds its permit briefly after reportingFINISHED. - The fix is well-scoped. Rejection beyond capacity stays covered:
tests/agent_server/test_run_admission.pybuilds its ownConversationServicewithmax_concurrent_runsof 1 and 2 and does not consume the stress fixture, so raising the stress cap loses no admission coverage. No other stress test depends on the cap. - The targeted flake is addressed. With the change, all 16 concurrent conversations start with no run-limit rejection. (In my environment the test still fails on step 5's pre-existing wall-time budget,
concurrent_wall ~0.80svsref_wall * 4.0 ~0.64s; I reproduced the identical wall-time failure on the unmodified base048c9be7with no run-limit rejection, so that is the unrelated timing flake, not this PR's target.) - Current-head CI is green on the required gates:
agent-server-stress-tests,pre-commit, andValidate PR descriptionall pass. The earlierValidate PR descriptionfailure is resolved now that the## Issue Numbersection readsRelated: #5404(a realready-for-devissue) rather than a bare reference to the closed PR#5350. - Linked issue
#5404is open withready-for-devandpriority:low; this test-side mitigation is consistent with that issue continuing to track the underlying permit-release bug.
No material correctness, security, or compatibility findings on the current head.
✅ APPROVED
|
PR #5397 is complete and merged: #5397
The PR was merged by |
Co-authored-by: openhands <openhands@all-hands.dev> (cherry picked from commit 8034b0d)
HUMAN:
The agent-server stress job started failing intermittently on unrelated PRs (e.g. #5151) after #5350 added run admission. This gives the concurrent-conversations benchmark the one extra run slot it needs.
AGENT:
Why
test_concurrent_conversations_isolated_and_fastruns one reference conversation, then startsn(16) conversations at once. Since #5350 the stress fixture caps the server at exactlymax_concurrent_runs=n. The reference run can still hold its run permit for a moment after its status readsFINISHED, so the last of thenconcurrent starts is sometimes rejected withConversationRunLimitExceeded("Conversation run limit reached").Seen on #5151's
agent-server-stress-testsjob (run 36706621324), and reproduced locally on unmodifiedmain: 2 of 3 runs failed.Summary
n + 1concurrent runs, leaving room for the reference conversation. Rejection beyond capacity is still covered bytest_run_admission.py.Issue Number
Related: #5404
How to Test
main: 2 of 3 runs failed withConversationRunLimitExceeded.-m stress tests/agent_server/stress) passes, 13 tests.Type
Notes
Test-only change.
🤖 Generated with Claude Code; updated by OpenHands on behalf of the PR author.
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdkpython-node-runtimepython-node-runtimepython-node-runtimegolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:ef5b827-pythonRun
All tags pushed for this build
About Multi-Architecture Support
ef5b827-python) is a multi-arch manifest supporting both amd64 and arm64ef5b827-python-amd64) are also available if needed