Repository navigation
fix(gateway): stop completed task terminals from blocking restarts - #121055
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 9, 2026 12:12
steipete
force-pushed
the
codex/terminal-task-cleanup
branch
from
August 9, 2026 12:21
0bd67f3 to
6b62e8d
Compare
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 10, 2026
…penclaw#121055) * fix(gateway): close task-owned terminals on completion * test(gateway): isolate terminal task lifecycle coverage * chore(plugin-sdk): refresh API baseline
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.
What Problem This Solves
Fixes an issue where completed detached tasks could leave their agent-owned workspace terminals alive indefinitely. On a busy Gateway, twelve idle PTYs from already-succeeded cron tasks remained restart blockers, repeatedly fencing a verified deployment even though the task ledger correctly reported completion.
Why This Change Was Made
Task completion now closes every terminal owned by that exact run-scoped cron, subagent, or ACP session after the authoritative task row reaches a terminal state. Persistent normal-chat sessions and connection-owned operator terminals keep their existing lifetime, while shared viewers receive the normal terminal exit event and PTY teardown remains centralized in the terminal session manager.
The task event is broadcast before teardown, preserving the observable order: durable task completion, task status update, then terminal closure. Later updates to an already-terminal task do not close resources belonging to a newer lifecycle owner.
User Impact
Completed background tasks no longer strand invisible workspace shells or indefinitely block safe Gateway restarts and managed deployments. Operators can still keep ordinary chat-owned terminals open, and attached connection-owned terminals retain their documented persistence behavior.
Evidence
succeeded; the Gateway suspension gate continued reporting terminal-session blockers.AI-assisted: yes. The implementation and proof were reviewed against the task registry, cron finalization, Gateway subscription, terminal ownership, and viewer cleanup boundaries.