Skip to content

refactor(cli): share token window presentation and output capture - #14382

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/cli-output-windows
Nov 24, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/cli-output-windows

Conversation

@vincentkoc

Copy link
Copy Markdown
Collaborator

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 --check passed. Hosted CI runs the package-backed checks.

Human owner: @vincentkoc.

@vincentkoc
vincentkoc marked this pull request as ready for review November 24, 2026 17:01
@vincentkoc
vincentkoc enabled auto-merge (squash) November 24, 2026 17:01
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T17:01:12.384804Z
We couldn’t complete this review. Comment @codex review to try again.
12f2529 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Shares token-window text, truncation markers, and continuation offsets across CLI output paths.

  • CLI output pages now share one truncation marker and continuation point.
  • CLI tests share one buffered output fixture.

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]
Loading

Reviews (1) · Last reviewed commit: "refactor(cli): share token window presen..." · Reviewed by Greptile

@vincentkoc
vincentkoc merged commit b016a09 into main Nov 24, 2026
42 checks passed
@vincentkoc
vincentkoc deleted the refactor/cli-output-windows branch November 24, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant