fix(release): stabilize v0.8.52#2626
Conversation
There was a problem hiding this comment.
Hmbown has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
Code Review
This pull request bumps the project version to 0.8.52 and introduces a stale sub-agent heartbeat auto-cancellation mechanism to release concurrency slots when a child agent stops making progress. It also adds support for the SiliconFlow China region provider (siliconflow-CN) and ensures legacy SSE MCP reconnects are retryable. A critical issue was identified in the sub-agent auto-cancellation logic: aborting a sub-agent's task prevents a completion event from being sent, which can lead to a high-CPU busy loop or state desync in the engine's turn loop.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| () = tokio::time::sleep(self.config.subagent_heartbeat_timeout) => { | ||
| let auto_cancelled = { | ||
| let mut mgr = self.subagent_manager.write().await; | ||
| mgr.cleanup(std::time::Duration::from_secs(60 * 60)) | ||
| }; | ||
| if auto_cancelled > 0 { | ||
| let _ = self | ||
| .tx_event | ||
| .send(Event::status(format!( | ||
| "Auto-cancelled {auto_cancelled} stale sub-agent(s) after no progress" | ||
| ))) | ||
| .await; | ||
| } | ||
| } |
There was a problem hiding this comment.
Potential Busy Loop and State Desync on Sub-Agent Auto-Cancellation
When a stale sub-agent is auto-cancelled in cleanup, its task handle is aborted (handle.abort()). Because the task is terminated abruptly, the code at the end of run_subagent that sends the completion message to tx_subagent_completion is never executed.
As a result, the Engine's turn loop waiting in turn_loop.rs never receives a SubAgentCompletion for the cancelled sub-agent. Since completions remains empty and running_count() becomes 0, the inner wait loop breaks. However, because the turn state is never updated with a completion for this sub-agent, the outer 'turn_loop will continue to the next iteration in an inconsistent state. This can lead to:
- A high-CPU busy loop: Since
should_hold_turn_for_subagents(0, 0)is false, it immediately breaks the wait loop and continues, spinning indefinitely on the CPU. - A permanent hang/state desync: The engine still thinks the sub-agent is active/pending because it never received a completion.
Recommended Solution
- Modify
cleanupinSubAgentManagerto return the list of IDs of the auto-cancelled sub-agents (e.g.,Vec<String>). - In
turn_loop.rs, when auto-cancelled sub-agents are detected, construct and push correspondingSubAgentCompletionobjects intocompletions, and thenbreakthe inner loop so they are processed normally by the engine.
() = tokio::time::sleep(self.config.subagent_heartbeat_timeout) => {
let cancelled_ids = {
let mut mgr = self.subagent_manager.write().await;
mgr.cleanup_and_get_cancelled(std::time::Duration::from_secs(60 * 60))
};
if !cancelled_ids.is_empty() {
let _ = self
.tx_event
.send(Event::status(format!(
"Auto-cancelled {} stale sub-agent(s) after no progress",
cancelled_ids.len()
)))
.await;
for id in cancelled_ids {
completions.push(SubAgentCompletion {
agent_id: id,
result: SubAgentResult::Cancelled, // Adjust to match actual SubAgentResult variants
});
}
break;
}
}There was a problem hiding this comment.
Hmbown has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Co-authored-by: Hanmiao Li <894876246@qq.com>
There was a problem hiding this comment.
Hmbown has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Summary
This makes v0.8.52 the corrective release line after the partial/messy v0.8.51 cut. The important release truth is:
codewhale@0.8.51was missing and crates.io only had part of the workspace.Changes in this PR:
siliconflowcredential slot[subagents] heartbeat_timeout_secsdefaulting to 300sPOST /messagesrequestsI also left maintainer notes on the PRs/issues most affected by the messy landing or this overnight triage: #2584, #2587, #2588, #2603, #2606, #2614, #2616, #2617, #2618, #2619, #2620, #2621, #2623, #2624, #2625, and #2627.
Release handling
mainin workspace order.Validation
cargo fmt --all -- --checkpython3 scripts/check-provider-registry.pybash scripts/release/check-versions.shbash scripts/release/verify-workspace-version.sh 0.8.52cmp -s CHANGELOG.md crates/tui/CHANGELOG.mdnpm testinnpm/codewhale(22/22)cargo check --workspace --all-features --lockedcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test -p codewhale-tui sidebar_work_summary --all-features --locked(4/4)cargo test -p codewhale-tui work_panel --all-features --locked(4/4)cargo test --workspace --all-features --locked(codewhale-tui: 3941 passed, 4 ignored; full workspace/doc tests passed)bash scripts/release/publish-crates.sh dry-runNotes
The dependent crates report package verification rather than full upload dry-run until their internal 0.8.52 dependencies exist on crates.io; the independent crates package, verify, and reach the dry-run upload step successfully.