Skip to content

fix(assistant): restore streaming and model preparation actions - #259

Merged
chaxus merged 2 commits into
mainfrom
codex/assistant-streaming-demos
Oct 12, 2026
Merged

chaxus merged 2 commits into
mainfrom
codex/assistant-streaming-demos

Conversation

@chaxus

@chaxus chaxus commented Oct 12, 2026

Copy link
Copy Markdown
Member

Merge Verdict

[APPROVE] — Ready for review with the AI assistant retained as an experimental feature.

50 files · +1677 / -293 · assistant runtime, chat UI, locale entry points and demo documentation

Summary

  • Replace an unexplained disabled Send button with an explicit model preparation or reconnection action that preserves the draft and never sends automatically. Keep model loading and cancellation aligned in narrow sidebars.
  • Restore streaming for local schema answers, grounded reads and document drafts. Display only decoded answer/body text, validate the complete result, batch chat updates once per frame and prevent interrupted previews from becoming writable content.
  • Carry English explicitly from homepage and history entry points, use English for unsupported language preferences, and add four captioned English Word, Excel, PowerPoint and PDF recordings with previews and experimental-feature guidance in both READMEs.

Risk Analysis

Risk Level Mitigation
Incomplete streamed document content Medium Full response validation remains authoritative. Failed, cancelled or provider-reset previews remain readable but cannot be written into a document. A regression reproduces and protects the provider-reset case.
Setup mistaken for submission Low Preparation preserves the draft, does not echo or queue a request, and uses the same readiness logic for clicks, Enter and speech/programmatic input.
Experimental model accuracy Medium Qwen3 4B remains the default; no model change or production-quality claim is made. The guide documents inaccurate slide answers and PDF follow-up failures after a saved note.
Stream parser dependency Low Add the pinned MIT-licensed @streamparser/json package. Bound preview input size, cover escaped text and Unicode chunk boundaries, and keep complete-schema validation outside the presentation parser.

Design Decisions

  • Keep the existing provider-neutral runtime and editor adapters. Optional JSON streaming falls back to complete responses on providers without streaming support.
  • Trust immediate answer-only deltas only from the validated schema adapter. Generic tool-capable transports retain the existing deferred-text guard; tool arguments and reasoning envelopes are not displayed as answers.
  • Share one animation-frame update for text and layout, preserve history-reading position, and keep Markdown rendering at stream completion.
  • Retain current ranui components and theme tokens. Loading uses a text Stop action with keyboard focus restoration.
  • Store lightweight H.264 MP4 files, JPEG previews and English WebVTT captions directly in the repository. Recordings use fictional content and actual local inference; model preparation is omitted.

Code Concerns

  1. [Needs Decision] Experimental model quality is not production acceptance (docs/media/ai-demos/README.md:3, docs/media/ai-demos/README.md:53). During recording, the default model gave incorrect content answers and failed to finish some replies after a PDF note was saved. The PDF demo therefore shows verified reading, proposal review and cancellation. Keep the experimental designation; review model quality separately from host/editor correctness.

No outstanding merge-blocking findings were found in the reviewed changes. The stale browser assertion and unfinished-preview promotion discovered during submission review were fixed and verified.

Verification

Check Result
Formatting, oxlint and TypeScript Passed; immutable evaluation artifact validation also passed
Unit tests with coverage 5,087 passed across 172 files; 91.45% line coverage
Production Vite build and focused Chromium regressions 16 passed across Word, Excel, PowerPoint and PDF; includes preparation/reconnect, editable next drafts, resize/scroll/copy, English entry points and 360/640px loading layouts
Native model demo outcomes Word draft insertion and Undo/Redo, Excel A1:A10 values and B1 sum of 55, created PowerPoint slide, PDF page reading and cancellation with zero annotations
Media and README validation Four videos fully decoded; preview, caption and README links checked; 38 README compatibility tests passed
Privacy and commit hygiene 50 files scanned; no local paths, machine identity, personal email or credential-like content found; anonymous GitHub commit email used; no browser profiles, model weights or recording probes included
Hosted deployment checks Pending CI; Docker and Cloudflare Pages suites were not rerun locally

Conclusion basis

  • Verified: pnpm run lint:ts, pnpm run format:check, pnpm run test:coverage, and E2E_PORT=4313 pnpm exec playwright test test/e2e/assistant-loading-locale.spec.ts test/e2e/agent-composer-ux.spec.ts test/e2e/agent-product-entry.spec.ts --workers=2.
  • Verified: the unfinished-provider-reset regression failed before the fix and passed afterwards; native recordings and complete video decoding were inspected independently.
  • Reviewed from source: exported streaming/readiness contracts and their consumers, cancellation and error paths, locale URL callers, dependency/lockfile changes and the final branch diff.
  • Not covered: production model-quality certification, hardware-wide performance benchmarks, and hosted Docker/Cloudflare checks until CI runs.

Stream validated local answers and drafts, batch chat updates, and preserve unfinished previews safely when providers reset. Keep preparation actions explicit and carry English locale preferences across editor entry points.

Add four captioned English AI demos and document experimental model limitations.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Deploying document with  Cloudflare Pages  Cloudflare Pages

Latest commit: b8a22b2
Status: ✅  Deploy successful!
Preview URL: https://f7fa31ee.document-7hm.pages.dev
Branch Preview URL: https://codex-assistant-streaming-de.document-7hm.pages.dev

View logs

@chaxus
chaxus enabled auto-merge (rebase) October 12, 2026 02:08
@chaxus
chaxus merged commit e450b45 into main Oct 12, 2026
19 checks passed
@chaxus
chaxus deleted the codex/assistant-streaming-demos branch October 12, 2026 02:08
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