fix(workbench): bound Agent Document responses and keep document markdown images controlled - #234
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 23551c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 1, 2026
main is red: #231 Agent Document stage broke runtime-inspector and public-api declaration tests
#240
Closed
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.
Folds the two post-merge Codex findings on #231 (#105 stage-2 document stage).
Fixes
runtime-routes.tsdocument route): the per-event and event-count limits could not prevent quadratic retained data from replacement-heavy streams, so the route now tracks the serialized response size while accumulating (separators included) against a named 16 MiB budget (agentDocumentResponseLimit— generous for real documents, small enough to keep the foreground server healthy). On exhaustion it aborts the decode via the decode stream's AbortSignal and answers with a new honest diagnostic, AB8209 (413) — never a truncated or fabricated event list. Unit-tested for both the budget rejection and the unaffected normal path.agent-document-stage.tsx+skill-markdown.tsx): the sharedMarkdownProjectoris now resolver-parameterized (resolveImage/resolveLink), the Skills page keeps its existing resource resolution, and the document stage resolves onlydata:image URIs — a markdown node referencing a remote image renders an inert placeholder (alt text + URL as text) instead of fetching it, so agent/model-produced output cannot trigger unsolicited network requests. Unit-tested: remote image → inert placeholder with no remoteimgsrc; data-URI image still renders.Verification
pnpm typecheck(incl. examples),pnpm lint(865 files): clean, re-run after rebase.runtime-playground.e2e.test.ts3/3 (Document tab unchanged for real runs).