feat(markdown): cite selected file text in chat - #282
Merged
Conversation
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
yaacovcorcos
marked this pull request as ready for review
September 11, 2026 04:29
yaacovcorcos
enabled auto-merge (squash)
September 11, 2026 04:29
yaacovcorcos
force-pushed
the
codex/markdown-file-citations-20260910
branch
from
September 11, 2026 04:51
88383e1 to
b21b966
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The chat's Cite action cannot currently capture selected text from a rendered workspace Markdown file. A plain file reference does not retain the selected passage or distinguish an unsaved draft from the file on disk.
Behavior and architecture
This first pass does not add PDF/HTML selection, whole-image/math/chart capture, source-mode capture, or a general annotation framework. Source lines enclose the selection; they are not claimed to be exact Markdown character offsets.
Verification
Automated qualification and manual acceptance are separate. Native visual review is pending with the owner; no computer-use or browser automation was performed, per request.
Focused coverage includes mounted ProseMirror/CodeMirror selection, the real composer and comment popover, serialization/paste/reload/removal, sanitized sent-message rendering, route identity and pending-save deferral, Strict Mode highlight cleanup, and the common provider boundary with mocked adapters. Stress cases include 250 repeated edit/capture cycles, 5,000 repeated paragraphs, Unicode/CRLF, malformed payloads, and 20,000 unfinished links. Tests also reject selections crossing a rendered chart's hidden source.
Passed:
git diff --check.6c583620ff7ad3235b135af7107c0543467eecfa, and upstream provenance verification.Before delivery, the unpublished branch was checked against fresh
origin/mainat7cefb603ef43fe0c4555826ceeb67b0e2338c668and had no intervening main commits to integrate. Initial qualification exposed an Electron auto-install race in the fresh dependency tree; explicitly completing the local Electron install resolved it without product changes. A loaded parallel run also exceeded the existing editor performance threshold; the clean full-suite and final frontend reruns passed without weakening any threshold.Documentation impact
Updated —
docs/user/composer.md,docs/internals/scient-rich-markdown-editor.md, andUPSTREAM.mddocument the workflow, narrow architecture, and deliberate shared-entry-point extension.Agent disclosure
Implemented and reviewed with OpenAI Codex in the Codex desktop agent harness. The exact model identifier is not exposed in this session. Provider tests use mocks; real-provider interaction and visual acceptance are left to the owner's isolated dev-app review.