Skip to content

Unload terminal agents after an idle timeout - #606

Merged
GraciousGazelles merged 32 commits into
mainfrom
fix/terminal-agent-idle-unload-timeout
Aug 23, 2026
Merged

GraciousGazelles merged 32 commits into
mainfrom
fix/terminal-agent-idle-unload-timeout

Conversation

@GraciousGazelles

Copy link
Copy Markdown
Collaborator

Summary

  • unload terminal Multi-Agent V2 runtimes after a configurable idle timeout while preserving their reloadable identity and queued messages
  • guard unloads against resumed work, pending terminal finalization, accepted submissions, active turns, and background terminals
  • restart the watcher after a cold agent reload and allow a zero timeout to disable the behavior

Validation

  • cargo fmt --all -- --check
  • git diff --check
  • GitHub-hosted checks will validate the Rust test suite and lints

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a terminal idle unload feature for multi-agent configurations, allowing idle terminal agents to be unloaded after a configurable timeout. It implements tracking for residency transitions, terminal finalizers, and pending submissions to ensure agents are not unloaded prematurely during active operations. Comprehensive unit tests are also added to verify the unloading lifecycle and its edge cases. The feedback suggests improving panic safety in async_watcher.rs by wrapping the terminal finalizer cleanup in an RAII guard to guarantee it runs even if the spawned task exits unexpectedly.

@GraciousGazelles
GraciousGazelles force-pushed the fix/terminal-agent-idle-unload-timeout branch 4 times, most recently from 963e27e to b670527 Compare August 14, 2026 16:59
@GraciousGazelles
GraciousGazelles added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@GraciousGazelles
GraciousGazelles added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@GraciousGazelles
GraciousGazelles added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@GraciousGazelles
GraciousGazelles added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@GraciousGazelles
GraciousGazelles force-pushed the fix/terminal-agent-idle-unload-timeout branch from 075dd77 to b00ed31 Compare August 20, 2026 23:38
@GraciousGazelles
GraciousGazelles force-pushed the fix/terminal-agent-idle-unload-timeout branch from b00ed31 to c1853df Compare August 21, 2026 00:56
@GraciousGazelles
GraciousGazelles added this pull request to the merge queue Aug 23, 2026
Merged via the queue into main with commit 097c362 Aug 23, 2026
132 of 135 checks passed
@GraciousGazelles
GraciousGazelles deleted the fix/terminal-agent-idle-unload-timeout branch August 23, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant