Repository navigation
refactor(cli): share token window presentation and output capture - #14382
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryShares token-window text, truncation markers, and continuation offsets across CLI output paths.
Acknowledged context: vincentkoc states “No linked issue.” This is not repeated as a finding. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
D[Discovery documents] --> W[formatTokenWindow]
R[Successful command pages] --> W
F[Command failure envelopes] --> W
E[Dispatcher failures] --> W
W --> S[sliceTextByTokenWindow]
S --> P[Page text and token positions]
P --> M[Shared marker and nextOffset]
M --> C[Caller chooses envelope and final newline]
Reviews (1) · Last reviewed commit: "refactor(cli): share token window presen..." · Reviewed by Greptile |
Summary
Share token-window text, the truncation marker and continuation offsets across discovery, command results and both failure renderers. Each caller still chooses its document and newline policy. A fitting full-output envelope retains the native value. TOON checks the actual text it will emit.
Seven CLI suites reuse a synchronous buffered output fixture. Their specialized streams still exercise delayed writes, backpressure, errors and encoding boundaries.
Scope
Internal CLI and test maintenance identified through repeated function review. No linked issue. Caller options, output formats, SDK interfaces and release metadata are unchanged.
Validation
Compared four production paths with their base-revision counterparts in 5,688 standalone cases using deterministic tokenizer and formatter doubles. The cases included empty and out-of-range pages, native falsy results, surrogate pairs, unpaired surrogates, trailing newlines and continuation offsets. The tokenizer itself is unchanged. Real Node streams verified capture and TTY behavior across split UTF-8 bytes. Seventeen identical collectors were replaced and all thirteen specialized stream constructions matched the base revision. TypeScript syntax, imports, formatting and
git diff --checkpassed. Hosted CI runs the package-backed checks.Human owner: @vincentkoc.