Skip to content

fix: harden accept gating, unicode handling and installer for OpenCode 2.2.6 - #20

Merged
ozandogrultan merged 6 commits into
mainfrom
fix/v2-review-hardening
Nov 8, 2026
Merged

ozandogrultan merged 6 commits into
mainfrom
fix/v2-review-hardening

Conversation

@ozandogrultan

Copy link
Copy Markdown
Owner

Summary

Hardening pass checked against OpenCode V2 2.2.6 and OpenTUI 0.8.3. The TUI plugin API is unchanged since 2.2.5.

  • Accept keys: the accept command's enabled now uses the full eligibility check (visible suggestion, empty idle composer, normal mode, focused), so keys fall through to the host whenever accepting isn't possible.
  • Toggles: /suggest on/off and debug compute the new value inside the store updater, so a quick double press can't write the same value twice.
  • Unicode: suggestions are clipped by grapheme (Intl.Segmenter) and maxChars counts graphemes. The transcript is sliced by code points, so it can no longer send half of a surrogate pair. Multi-code-point input (IME chunks, combining marks) counts as typing and cancels generation.
  • Output filtering: model output starting with NONE (e.g. NONE - done, **NONE**) is treated as no suggestion.
  • Model resolution: both capability checks now use one strict rule: a model must list text input and text output.
  • Installer: the inline Node moves from install.sh to scripts/install.mjs. Every write is planned first, then applied atomically (temp file plus rename), keeping the file mode and following symlink chains. lint:sh runs node --check on it.
  • Dependencies: @opentui/* goes to ^0.8.1, the floor that the 2.2.6 plugin package declares. @opencode/client is pinned as a devDependency, since its types were imported without being declared.
  • Cleanup: removed the test-only helpers ghostKeymapLayers and findComposerEditor, and the unused Promise model path in stateless.ts.

@opencode/plugin stays at 2.2.5 because 2.2.6 is still inside the 3-day minimumReleaseAge window. Its TUI types are identical to 2.2.5.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / internal

Checklist

  • bun run test passes.
  • bun run typecheck passes.
  • bun run lint:sh and bash scripts/changelog.sh check pass.
  • Read the "Caveats" section of the README; this change does not regress the
    prompt.footer composer marker, placeholder ownership or scoped accept-key behaviour.
  • I updated the docs where behaviour changed; released changelog entries remain unchanged.

@ozandogrultan
ozandogrultan merged commit c27de3e into main Nov 8, 2026
8 checks passed
@ozandogrultan
ozandogrultan deleted the fix/v2-review-hardening branch November 8, 2026 11:23
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