fix(cli): release workspace resources after success - #1241
Merged
Conversation
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
after_invokeboundaryworktree finalizecoverage using a merged-PR-shaped receipt andowner-terminal-outcome=successRoot Cause
The existing boundary deferred resource release until WordPress
shutdown. A successful finalizer could commit metadata and render its receipt while the request-owned database connection remained open; a later shutdown participant could then retain the process and its SQLite lock. The regression fixture verifies current-main behavior deterministically by making that later participant wait only while the DB remains open.The shared workspace
after_invokecallback is the smallest generic owning layer: it runs after successful command output and before PHP shutdown, while failures beforeafter_invokeretain the normal shutdown lifecycle and nonzero status.Closes #1234.
Verification
Passed:
php tests/workspace-cli-bounded-exit.phpphp tests/workspace-command-startup-bounds.phpphp tests/workspace-help-cli-lifecycle.phpphp tests/workspace-list-cli-format-contract.phpphp tests/workspace-show-cli-format-contract.phpphp -lchecksgit diff origin/main...HEAD --checktests/*.phptest except the unchanged baseline failure belowThe full standalone loop stops at
tests/worktree-add-lifecycle.phpwithpartial success omitted its exact read-only continuation. The same environment-sensitive failure is documented on current main in PR #1198, and this PR does not modify that test or the implicated handoff lifecycle. Rerunning all standalone tests while skipping only that baseline test passes.worktree-command-wp-cli-synopsis.phpreports its existing skip becauseWP_CLI_ROOTis unavailable.AI Assistance
OpenAI GPT-5.6 Sol via OpenCode read the issue and history, traced the removed process-boundary coverage, implemented the owning-layer resource finalizer and process fixture, and ran the verification above. Chris Huber directed the work and remains responsible for the change.