Repository navigation
refactor(sdk): simplify CLI completion and display state - #1384
Open
mldangelo-oai wants to merge 1 commit into
Open
mldangelo-oai wants to merge 1 commit into
mldangelo-oai wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kmbroai
approved these changes
Oct 7, 2026
kmbroai
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the complete lifecycle and listener changes, including completion, errors, cancellation, forced termination, dashboard cleanup, and history wrapping. All 259 focused tests passed locally; current CI is passing. No actionable findings at this commit.
This branch has not been deployed
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
The CLI tracks child-process completion and terminal updates with state that duplicates existing mechanisms. Remove those extra flags and bookkeeping while preserving completion, cancellation, terminal cleanup, and displayed output.
Changes
Rely on a Promise settling only once for child completion and errors. Use the existing stream-generation counter to identify the active progress session during listener cleanup. Remove redundant dashboard state updates, write frames directly, and use the remaining first-line prefix to track history indentation.
Testing
In the recorded focused run, a real child-process fixture ignores SIGTERM and verifies that CLI cancellation still settles with exit status 143. Writable-stream fixtures inject asynchronous output failures and check that error listeners remain until output settles, then are removed. Dashboard fixtures check terminal restoration after rendering/setup failures, and history fixtures check visible content at narrow and wide widths.
After building the bundled plugin, repeat from
sdk/typescriptwithbun test tests-ts/cli.test.ts tests-ts/cli-skills.test.ts tests-ts/scan-dashboard.test.ts tests-ts/scan-history-renderer.test.ts. The SIGTERM fixture is POSIX-only.Risk and rollout
No CLI syntax or output-format changes are intended. Completion and stream cleanup must remain correct when events arrive after cancellation or after progress restarts.
Public disclosure review