feat(core): auto-shutdown idle orchestrators after configurable timeout#661
Open
sisutuulenisa wants to merge 4 commits intoComposioHQ:mainfrom
Open
feat(core): auto-shutdown idle orchestrators after configurable timeout#661sisutuulenisa wants to merge 4 commits intoComposioHQ:mainfrom
sisutuulenisa wants to merge 4 commits intoComposioHQ:mainfrom
Conversation
added 3 commits
March 24, 2026 14:58
Orchestrators that have no active worker sessions remain running indefinitely, wasting resources. This adds an idle-shutdown mechanism: - New config field: orchestratorIdleTimeoutMs (default: 600000 = 10 min) - Lifecycle manager tracks per-project idle-since timestamp - When no active workers exist beyond the timeout, the orchestrator session is automatically killed - Emits session.orchestrator_idle_shutdown event for notification - Timer resets immediately when workers become active - Set to 0 to disable This complements the watchdog's restart-on-work logic: orchestrators shut themselves down when idle, and get restarted when new issues appear.
ao status now filters out sessions with terminal statuses (killed, done, merged, terminated, cleanup) that have no live runtime. These are stale metadata files awaiting cleanup/archival. Use --all / -a to see everything including stale sessions (useful for debugging). This addresses the root cause of stale orchestrator/worker entries persisting in status output after sessions have ended.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Author
|
I re-checked both Bugbot findings on the current branch head and they are already covered in code:
Validation rerun on head:
No extra patch needed on top of current branch state. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Consolidated idle-orchestrator shutdown line from
#546onto a clean branch frommain.Included work:
orchestratorIdleTimeoutMssession.orchestrator_idle_shutdownevent emission for notifier visibilityVerification
pnpm install --frozen-lockfile pnpm --filter @composio/ao-core typecheck pnpm --filter @composio/ao-core build pnpm --filter @composio/ao-core test -- src/__tests__/lifecycle-manager.test.ts pnpm --filter @composio/ao-plugin-agent-claude-code build pnpm --filter @composio/ao-plugin-agent-codex build pnpm --filter @composio/ao-plugin-agent-aider build pnpm --filter @composio/ao-plugin-agent-opencode build pnpm --filter @composio/ao-plugin-scm-github build pnpm --filter @composio/ao-cli typecheck pnpm --filter @composio/ao-cli buildCloses #532.