Skip to content

fix(desktop): send quote-only and attachment-only messages - #4805

Open
Jarad-z wants to merge 1 commit into
apache:mainfrom
Jarad-z:codex/structured-only-messages
Open

fix(desktop): send quote-only and attachment-only messages#4805
Jarad-z wants to merge 1 commit into
apache:mainfrom
Jarad-z:codex/structured-only-messages

Conversation

@Jarad-z

@Jarad-z Jarad-z commented Sep 4, 2026

Copy link
Copy Markdown

Summary

Maka Desktop treated MessageContent.text as the only substantive input at several boundaries even though quotes and attachments are model-visible content. A quote-only send could be blocked in the composer or rejected during admission; after reaching the runtime, the durable replay predicate classified it as empty and failed the turn before the provider request. Attachment-only sends hit the same text-only admission assumption.

This change:

  • makes staged quotes and attachments sufficient to enable and submit the composer;
  • admits structured-only content through Desktop IPC, Runtime Host protocol, and root-turn persistence;
  • preserves quote and attachment content through durable RuntimeEvent replay;
  • suppresses the filled user bubble when there is no text body while retaining message metadata;
  • keeps truly empty messages invalid.

Fixes #4804

Verification

Claim Command Result
Desktop production build and workspace typechecks npm run build:with-deps from apps/desktop passed
Composer and transcript regressions node --test packages/ui/dist/__tests__/composer-send-toggle.test.js packages/ui/dist/__tests__/chat-turn-answer-identity.test.js 18 passed, 0 failed
Desktop IPC admission node --test apps/desktop/dist/main/__tests__/permission-response-ipc-boundary.test.js 6 passed, 0 failed
Core visibility and root admission node --test packages/core/dist/__tests__/runtime-event.test.js packages/storage/dist/__tests__/root-turn-admission-normalization.test.js 29 passed, 0 failed
Runtime Host wire boundary node --test packages/runtime-host/dist/__tests__/protocol.test.js 77 passed, 0 failed
Durable model replay node --test packages/runtime/dist/__tests__/ai-sdk-backend.test.js packages/runtime/dist/__tests__/directory-reference-model-context.test.js packages/runtime/dist/__tests__/runtime-event-read-model.test.js passed
Desktop quote-only journey npx playwright test e2e/send-message.spec.ts --grep "reference-sized paste" --config e2e/playwright.config.ts from apps/desktop 1 passed
Lint npm run lint 3,278 files clean
Changed-file format and whitespace npx biome check on the 16 changed files; git diff --check passed

Not run: the full Electron E2E suite. The focused user journey and all affected lower-tier suites passed.

Full-tree npm run format:check and npm run check:asf-headers are not claimed: the checkout contains unrelated untracked artifacts and Windows-line-ending baseline files outside this PR that fail those whole-tree commands. All changed files pass the targeted formatter check and retain their ASF headers.

Root cause

runtimeEventHasModelVisibleContent returned false for every text event whose text field was empty. The model-history formatter separately folds quotes, attachments, and directory references into provider-visible text, so the visibility predicate and the materializer disagreed. The durable current-turn replay therefore emitted empty_text_skipped, materialized no current user message, and failed closed as a non-replayable projection. The UI and admission boundaries repeated the same text-only predicate.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex — reproduced the Desktop failures, traced the persisted RuntimeEvent and replay diagnostics, implemented the UI/admission/replay fixes, added regression coverage, ran the verification above, and drafted the issue and PR descriptions. The commit carries a Generated-by: OpenAI Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Jarad-z
Jarad-z force-pushed the codex/structured-only-messages branch from c1036d8 to 0311ad1 Compare September 4, 2026 18:11
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: quote-only and attachment-only messages require inline text

1 participant