Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24cd479cc8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| FOOTNOTE_REFERENCE_RE.test(repaired) || | ||
| FOOTNOTE_DEFINITION_RE.test(repaired) || | ||
| markdownRenderScope(markdown) === "document" | ||
| markdownRenderScope(repairedDocument) === "document" |
There was a problem hiding this comment.
Avoid making repaired-only document scope sticky
When a stream contains a definition and temporarily ends in an incomplete reference such as [ref]: /docs\n\nSee [docs][ref, remend synthesizes the final ], so this condition calls renderFullDocument and sets fullDocumentMode. If the next appended character makes the reference invalid (for example, a newline before its closing bracket), the repaired document returns to block scope, but the early return at line 1341 keeps rendering the entire document for every subsequent append. Thus a final reply that should use block rendering permanently loses per-block code controls and incremental performance; repaired-only scope needs to be re-evaluated as the stream grows rather than entering the sticky path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e7fe6eb: only a source-level pair enters the sticky path; a repaired-only document renders once and is re-scoped on the next frame.
|
Thanks for spelling that out. The scoping change is independent of #10688. Once that one lands, this PR is only I dropped the extra blank lines in I also merged main in, so the three red checks from the uv-cache workflow guards should clear with #10826. |
5a4484a to
3b27f31
Compare
… non-sticky Resolve conflicts toward main: the link probe rewrites on main (unslothai#9645, unslothai#11375) replace unslothai#10688's hunks, and the repaired-document scope does not depend on them. A reference that remend closes early now renders as one document, but only a source-level pair enters the sticky full-document path, so a stream that abandons the reference returns to blocks.
… on a tail definition
|
Thank you for the PR and the careful test case. Closing this one because #12104 has since removed the condition it fixes. This PR scoped the render from the repaired document because remend used to close a mid-stream Measured on current main (
So merging it now would add a second scope check per frame with no behaviour change. Happy to reopen if a case turns up where the repaired and source scopes still diverge. |
Summary
IncrementalMarkdownCache.updatenow scopesmarkdownRenderScopefrom the repaired document. While a reply is mid-way through[docs][ref, remend closes the bracket early, so the rendered text is already one document. The incremental path used to keep a committed prefix plus a tail for those frames (block mismatch at prefix 230 in the new test).[docs][reffollowed by a blank line) goes back to blocks.][seam, so ordinary frames cost the same as before.Test plan
studio/frontendstreaming-render-scheduleandlink-definition-oracletests (51 pass)