Repository navigation
Conversation
981a7f7 to
d2841dc
Compare
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
6e33238 to
62a0e60
Compare
3a1fcb6 to
e4290f4
Compare
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: verl-project/uni-agent/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
70b7dcd3-41b6-4193-bee1-caaca7f58330
📒 Files selected for processing: 4
tests/uni_agent/framework/test_generate_sequences_on_cpu.pytests/uni_agent/gateway/test_gateway_manager_on_cpu.pyuni_agent/framework/framework.pyuni_agent/gateway/manager.py
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| try: | ||
| await self.abort_session(session_id) | ||
| except (Exception, asyncio.CancelledError): | ||
| # A failed abort leaves this owner available for an explicit retry. | ||
| logger.exception("session %s: abort failed after cancelled create", session_id) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
rg -nP -C8 'gateway_manager\.(create_session|abort_session)\s*\(' uni_agent/frameworkRepository: verl-project/uni-agent
Length of output: 3593
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- framework lifecycle ---'
nl -ba uni_agent/framework/framework.py | sed -n '770,885p'
printf '%s\n' '--- manager implementation ---'
nl -ba uni_agent/gateway/manager.py | sed -n '1,190p'
printf '%s\n' '--- relevant diff ---'
git diff --no-ext-diff --unified=25 31a499eb2e4b16bb5fdc609ddf444b9a3b5d11f3 e4290f4715268faf471ad301a43405336b72c3d0 -- uni_agent/framework/framework.py uni_agent/gateway/manager.pyRepository: verl-project/uni-agent
Length of output: 25285
🏁 Script executed:
set -o pipefail
nl -ba uni_agent/framework/framework.py | sed -n '780,885p'
nl -ba uni_agent/gateway/manager.py | sed -n '1,190p'
git diff --no-ext-diff --unified=20 31a499eb2e4b16bb5fdc609ddf444b9a3b5d11f3 e4290f4715268faf471ad301a43405336b72c3d0 -- uni_agent/framework/framework.py uni_agent/gateway/manager.pyRepository: verl-project/uni-agent
Length of output: 23616
🏁 Script executed:
set -o pipefail
rg -n -F --glob '*.py' -e 'async def abort_session' -e 'def abort_session' -e 'async def shutdown' -e 'def shutdown' uni_agent/gateway
printf '%s\n' '--- gateway actor lifecycle ---'
nl -ba uni_agent/gateway/gateway.py | sed -n '1,260p'Repository: verl-project/uni-agent
Length of output: 13784
🏁 Script executed:
nl -ba uni_agent/gateway/gateway.py | sed -n '252,310p'Repository: verl-project/uni-agent
Length of output: 2530
Retry failed cleanup for cancelled creates.
GatewayManager.create_session calls _abort_cancelled_create when creation is cancelled, but that helper calls abort_session only once. If the remote abort fails, the route and load slot remain allocated. The actor also keeps the session because it removes it only after session.abort() succeeds. The Framework's later cancellation handler cannot handle cancellation of the preceding create_session await. Add a bounded, cancellation-safe retry, or track the session for shutdown cleanup.
Summary
Cancelling a Gateway session creation can leave the remote actor session alive after its manager owner is removed. Wait for the create result and abort only the session that call successfully created, even when cancellation repeats. This is a self-contained lifecycle bug fix and needs no separate issue.
Changes
Route binding, route release and model-version semantics are implemented separately in the dependent #244. This PR adds no backend route hooks or custom release exceptions.
Validation
Local Python 3.12, with this checkout and its pinned public verl commit
2bc6ac46043e31855cea194236ff7548c91817c8explicitly selected: 226 CPU tests passed, 1 deselected, covering remote creation, repeated cancellation, retained abort ownership, duplicate IDs, concurrent closes and runner-error preservation. All-file pre-commit andgit diff --checkpassed. No accelerator-training claim is made.python -m pytest -q \ tests/uni_agent/framework/test_generate_sequences_on_cpu.py \ tests/uni_agent/gateway/test_gateway_actor_on_cpu.py \ tests/uni_agent/gateway/test_gateway_manager_on_cpu.py \ tests/uni_agent/gateway/test_session_multiple_chains_on_cpu.py \ -m 'cpu and level0' pre-commit run --all-files --show-diff-on-failure git diff --checkCompatibility
Public call signatures and ordinary backend behavior are unchanged. A cancelled create may wait for its remote result and owned abort rather than returning while that actor call is still running. IDs already owned by this manager are rejected before another create is dispatched.
Checklist
pre-commit run --all-files --show-diff-on-failurepasses.Summary by CodeRabbit