Skip to content

fix(pixel): retain dictation that exceeds composer capacity - #5546

Merged
gabsprogrammer merged 3 commits into
Osmantic:public-betafrom
tang-vu:feat/beta-dictation-capacity-recovery-20260916
Sep 19, 2026
Merged

gabsprogrammer merged 3 commits into
Osmantic:public-betafrom
tang-vu:feat/beta-dictation-capacity-recovery-20260916

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Pass the real draft and 16,384-character limit into dictation. Bound complete final transcripts using the composer's separator/slash rules and reserve accepted text immediately across back-to-back speech events. On overflow, stop the recognition session, preserve the draft and expose the rejected words for manual copying, insertion after editing, or explicit discard.

Why this matters

A final browser speech result currently appends without checking the existing draft, making the message unsendable. Merely truncating or ignoring the result would lose the user's spoken words; checking only rendered props also misses multiple final events in one render batch.

Behavioral invariant: Dictation never makes the composer exceed its page limit or silently truncates speech. The overflowing final text remains recoverable within the current conversation, and cancelled-session callbacks cannot overwrite it or insert into a new chat.

Overlap check

Searched open/closed PRs for dictation draft limit, dictation overflow and speech draft length, plus PixelDictation.jsx/Pixel.jsx history. #4151 adds send-key preferences; #5008 concerns offline draft availability. No earlier PR covers dictation capacity/recovery. Batch #5528 selects speech language and #5535 bounds selected-passage actions; those independent controls do not handle asynchronous speech results or retain rejected speech. Their combined behavior will be tested together.

Production/test paths: ods/extensions/services/dashboard/src/components/PixelDictation.jsx, ods/extensions/services/dashboard/src/pages/Pixel.jsx, ods/extensions/services/dashboard/src/pages/Pixel.dictation-capacity.test.jsx. The original main was fast-forwarded from verified upstream before branching; the explicitly requested target is public-beta at 3c186f3f12ba21dad7b7266ec5449393529abb00.

Regression and validation

Exact candidate: 9bad03b5f22c2e59d8db23467cd1be6a761650d3.

  • npx vitest run src/pages/Pixel.dictation-capacity src/components/PixelDictation --maxWorkers=4: 11 passed on Windows Node 24.14.1. 3 new public-boundary assertions fail with untouched beta production code, demonstrating the behavior addressed here.
  • Real Pixel-page tests cover a near-full draft, exact-fit first result followed by an overflowing second result before render, preservation and manual recovery, late cancelled results, editing during recognition, slash replacement, explicit discard, conversation reset and absence of POST/send activity. Existing dictation cancellation tests also pass.
  • Focused ESLint (no errors), Vite production build, git diff --check, and changed-file secret/private-key/large-file hooks pass.
  • The exact unchanged beta baseline already passed 1,232 dashboard tests, full lint and build. Linux baseline make lint, smoke and simulation passed. Full gate remains limited by two existing no-sudo Docker assertions under root; BATS has five baseline WSL/root/disk-space failures. Full-tree hooks also find dummy private-key fixtures and missing Windows awk. These are not represented as successful runtime gates.
  • Current-head CI and the synthetic batch integration are being monitored; final receipts will be added. No installed model, GPU, hardware fleet or live service qualification is claimed.

Compatibility and review

Uses the same JavaScript character count as the composer, not model-token estimation. Retained speech is temporary UI state and clears on conversation/availability changes or unmount; no new storage or automatic submit. Speech events are simulated and no microphone/browser-provider qualification is claimed. Revert removes the capacity guard and recovery UI.

Implementation and relevant local checks are complete, so this PR is Ready for review immediately. Independent review remains outstanding. No upstream merge or deployment is authorized by this PR.

Codex assisted with implementation and validation.

tang-vu and others added 3 commits September 16, 2026 22:23
# Conflicts:
#	ods/extensions/services/dashboard/src/pages/Pixel.jsx
usePortalContext now POSTs /api/pixel/chat/context on mount. The
dictation-capacity test asserted zero POSTs, which the read-only
context poll broke. Scope the assertion to state-changing POSTs so the
test again proves retained dictation never starts a send.
@gabsprogrammer
gabsprogrammer merged commit 3cb21f8 into Osmantic:public-beta Sep 19, 2026
42 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.

2 participants