Skip to content

fix(windows): remove writer that broke the completion dropdown; welcome commit hash#1179

Merged
diillson merged 2 commits into
mainfrom
fix/windows-completer-regression
Jul 12, 2026
Merged

fix(windows): remove writer that broke the completion dropdown; welcome commit hash#1179
diillson merged 2 commits into
mainfrom
fix/windows-completer-regression

Conversation

@diillson

Copy link
Copy Markdown
Owner

Regression fix — highest priority

Release 1.160.1 shipped a wrap-compensation ConsoleWriter for Windows that corrupted the entire terminal the moment the completion dropdown rendered (typing a slash). This PR removes it.

Root cause, provable from the go-prompt v0.2.6 source: renderCompletion writes every suggestion row up to the exact right edge of the terminal (the x+width guard aligns rows to end at the last column), then repositions using negative cursor-move arguments that the VT writer converts to the opposite direction. The wrapper tracked only positive movements, so its column model drifted on the first suggestion row and every row after that received a newline injection at the wrong position — the screen scrolled and tore on every keystroke.

Both prompts (main REPL and coder inter-turn input) are back on the standard writer. Everything else from the previous fix stays: the stdin reader fixes, path validation, JSON args repair, AltGr sanitation and the palette ghost-line erase.

Honest consequence: the pre-existing prompt-climb issue with large wrapped input on VT consoles is reopened. A renderer-level fix requires validation on a real Windows console before shipping — modeled unit tests already failed to catch this interaction once. Tracked for a future attempt, likely alongside the TUI migration.

Welcome screen commit hash

The welcome screen printed raw build info, so go install builds showed an unknown commit while /version displayed it fine after enriching from the GitHub release. The welcome screen cannot block boot on the network, so:

  • Release metadata fetched by any report is now persisted to a small on-disk cache under the chatcli home dir (atomic write, daily TTL).
  • The welcome screen reads an offline report that applies the same pure enrichment from that cache — zero network at boot.
  • Boot kicks a background, deadline-bounded refresh when the cache is stale; CHATCLI_DISABLE_VERSION_CHECK disables it too.

First boot after install shows the hash as unknown (nothing cached yet); every boot after that shows it. ldflags builds are unaffected — stamped data always wins.

Testing

  • Full suite green; builds for darwin, linux and windows; golangci-lint clean natively and with GOOS=windows; quality-gate scripts pre-checked locally.
  • New tests: cache round-trip, TTL expiry and corruption handling, offline-report enrichment and version-mismatch guard, cache seeding by the report path, refresh staleness and opt-out semantics.
  • No exported API removed; go.mod untouched.

diillson added 2 commits July 12, 2026 20:22
…letion dropdown

The wrap-aware ConsoleWriter shipped in the previous release corrupted
the whole terminal as soon as the completion dropdown rendered. Root
cause, provable from the go-prompt source: every suggestion row is
written up to the exact right edge of the terminal, and the renderer
then repositions with negative cursor-move arguments, which the VT
writer converts to the opposite direction. The wrapper only tracked
positive movements, so its column model drifted on the first row and it
injected newlines at wrong positions on every subsequent row — ten
scrolled lines per keystroke.

The compensation layer is removed and both prompts return to the
standard writer. This reopens the known prompt-climb issue with large
wrapped input on VT consoles; any new attempt at it must be validated
on a real Windows console before shipping, since unit tests against a
modeled terminal already failed to catch this interaction once.
…uilds

The welcome screen printed the raw build info, so builds installed via
go install showed an unknown commit even though the version command
displayed it after enriching from the GitHub release. The welcome
screen cannot pay for a network round-trip at boot, so the release
metadata fetched by any report is now persisted to a small on-disk
cache under the chatcli home directory, written atomically and expiring
daily. The welcome screen reads an offline report that applies the same
pure enrichment from that cache, and boot kicks a background refresh
bounded by its own deadline when the cache is stale. The update opt-out
variable disables the refresh as well.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Gate

Result: ✅ all floors passed

Floor Status Result Δ vs main Budget
1 · Build & Static go build / vet / fmt / lint
2 · Coverage 50.6% (bootstrap) 0 ≥ baseline
3 · Patch coverage 70.9% (req ≥ 60%) ≥ 60%
4 · AI smells diff scanned
5 · Scope budget ⚠️ 11 files / 692 LOC (code 692 + tooling 0) warn 800·25
6 · E2E go test -race ./e2e/... ≤ 15min
7 · Commit lint conventional commits
8 · Cyclo (new code) 3 file(s) under threshold ≤ 30
9 · Secrets scan gitleaks
10 · i18n parity missing 0, unknown 0
11 · CRD drift drifted: 0
12 · License headers 0 missing
13 · API breaking 0 incompatible
14 · Binary size chatcli 90.9MB · operator 52.3MB 100MB each
15 · Provider parity 15 providers · 0 violations

Config: .github/quality-gate.yml. Workflow: .github/workflows/quality-gate.yml.

@diillson diillson merged commit 7712a06 into main Jul 12, 2026
25 checks passed
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