Skip to content

1.7.0#75

Merged
liftaris merged 16 commits into
mainfrom
dev
May 21, 2026
Merged

1.7.0#75
liftaris merged 16 commits into
mainfrom
dev

Conversation

@liftaris
Copy link
Copy Markdown
Owner

Chat & composer

Security

Tests

  • 1037 pass / 0 fail · bunx tsc --noEmit clean · bun run build clean

github-actions Bot and others added 16 commits May 19, 2026 07:47
Split openFile into two exports: openFile (local paths, unchanged) and
openUrl (external URLs, http(s)-only, spawned with no shell).

openUrl parses via new URL() and rejects anything non-http(s) so a
model-emitted file:///, data:, or javascript: URL can never reach a
local handler. URLs are forwarded via child_process.spawn with an argv
array, so shell metacharacters (; & ` $ | < >) in query strings cannot
be interpreted as commands. Platform openers: open on darwin,
explorer.exe on win32 (not cmd /c start), xdg-open on Linux/BSDs,
no-op everywhere else.

A no-op 'error' listener is attached before unref() so ENOENT from a
missing xdg-open doesn't crash the TUI as an unhandled EventEmitter
event.
A /background task today produces one 'started' toast and then nothing
until completion — no way to confirm it is alive or see how many are
in flight.

- src/app/background.tsx: BackgroundProvider holding a ReadonlySet of
  in-flight task ids, register/unregister with identity-preserving
  no-ops, useBackground() exposing count + ids.
- slash.tsx registers the id when prompt.background resolves with a
  task_id; useStream unregisters on background.complete. Toast and
  transcript marker behavior unchanged.
- Composer renders a '▶ N' fragment between the queue-flush hint and
  the model label when count > 0, hidden at zero.
- Tests: provider semantics, composer fragment presence/absence, and
  the full register → complete lifecycle through MockGateway.
Harden open-file: protocol allowlist + safe spawn for URLs
Composer: show ▶ N indicator while background tasks run
Add src/app/parts.ts — thin PartsBuffer adapter over @opentui/core
extmarks. Mirrors opencode's shape (file/agent/text kinds with
asymmetric source fields) so snapshots round-trip and serialize as
parts[] for future wire migration.

Composer.tsx wires:
 - syntaxStyle + registered extmark.file/agent/paste style ids
 - PartsBuffer constructed on textarea ref bind, torn down on unmount
 - @-ref accept: complete refs (trailing space) land as styled chips,
   prefix keywords (trailing : or /) keep the classic write path
 - submit emits onSend(text, parts) after expanding text parts inline
 - history stores { input, parts } snapshots; legacy raw-string lines
   still load via the tolerant parser

useInputHistory.ts now takes HistEntry | string, persists JSONL.

No wire change: onSend accepts (text, parts?) but today's callers
only consume text. The parts[] side-channel unblocks a follow-up
gateway task without blocking this ship.
- test/parts.test.tsx: PartsBuffer unit coverage — insertText/insertPart
  ordering, listParts, atomic-chip backspace, plain-text backspace,
  deleteRange across a chip, snapshot round-trip, chip-at-start/end,
  adjacent chips, insert-before/after chip doesn't extend its range,
  expand() text-part inlining, sync() after mark deletion.
- test/composer-parts.test.tsx: Composer integration — submit emits
  Part[] matching the buffer, atomic backspace via the key handler,
  history restore rebuilds chips from a parts[] entry.
- Composer.tsx: the textarea ref callback was inline, so its identity
  changed every render → React called it with null+r again, and the
  null-call clobbered PartsBuffer.current mid-edit. useCallback it and
  route sids through a ref so theme swaps still rebuild through the
  genuine unmount path. Without this, the composer-level tests (and
  the real parts[] emission) can't keep a chip alive past one render.
atAccept rebuilt the whole textarea with setText() which clears every
extmark — so a second @-ref chip wiped the first chip's mark and submit
emitted only one FilePart. Splice the @word out via deleteRange instead;
the extmarks controller shifts remaining marks to absorb the deletion.

New test "two chips in a row → two FileParts" fails against the old
setText path and passes after.
- add voice state management hook (useVoice) + key parsing (platform.ts)
- register voice.record_key from config as global keybinding (ctrl+b)
- handle voice.status / voice.transcript gateway events
- show recording indicator (recording/transcribing/ready) in composer bar
- extend /voice command to return record_key, support on/off/tts/status
- auto-send transcribed text on capture (CLI parity with upstream)

new files: src/voice/{types,platform,useVoice,Indicator}.tsx
modified: app.tsx, gatewayEvents.ts, useAppKeys.ts, gateway-types.ts
status.update/kind=process events fire per terminal(background=true)
completion. when many finish in quick succession (builds, parallel
tests), each dispatches a {kind:system} action that triggers a full
Chat re-render -- causing visible TUI lag.

route process events through a 500ms debounced accumulator. rapid
completions coalesce into one combined system message.

events.ts: add onProcessNotification to Side callback type
useStream.ts: procs ref accumulates texts, flushProcs batches + dispatches
fix: debounce process notification events in TUI
@liftaris liftaris merged commit 71250c2 into main May 21, 2026
4 of 5 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants