Repository navigation
fix(docs/cli): unbreak cli.agentproto.sh — MDX comment markers in sandbox-rendezvous - #1256
Merged
Merged
Conversation
…dbox-rendezvous
cli.agentproto.sh mirrors docs/cli/ into content/docs/ and compiles it
with fumadocs-mdx. MDX has no HTML comments — it reads `<` as a JSX tag
open — so the `sync-templates` markers in this guide are a hard parse
error downstream:
29:2 Unexpected character `!` (U+0021) before name
That has failed every production build of agentproto/cli-site since
2026-07-12 — two months, including copy-only PRs, because the break
lives here and the red X lives there. (sync-content.mjs already rewrites
`<https://…>` autolinks for the same reason; HTML comments were the gap.)
Switch the two markers to the MDX comment form and teach sync-templates
that flavor. It already spoke two — `<!-- … -->` for markdown, `/* … */`
for .ts — so this is a third alternative in the same vocabulary, not a
new mechanism; every marked file keeps the flavor its own parser wants.
The fixture now uses `{/* … */}` for the docs file, so the three flavors
are covered by the existing round-trip tests.
Contributor
There was a problem hiding this comment.
Summary
Adds support for the MDX comment flavor ({/* … */}) in the sync-templates marker regexes and converts the docs/cli guide to it, since MDX (fumadocs-mdx) rejects HTML comments. Script/test/docs-only change; no workspace packages touched.
Changeset
| package | bump | reason |
|---|---|---|
| (none) | — | No workspace package changed; scripts/docs only, no changeset needed |
Findings
Correctness
- The updated
MARKER_START_RE/MARKER_END_REin scripts/sync-templates.mjs:385-390 correctly handle all three flavors (<!-- -->,/* */,{/* */}) with alternations on both open and close sides. Start requires a trailing newline, end is anchored on preceding newline — consistent with prior behavior. docs/cli/guides/sandbox-rendezvous.md:25,27marker conversion matches the new regex; round-trip is stable.
Test coverage
- scripts/sync-templates.test.mjs:49-51 updated the fixture to the MDX flavor, but only the HTML flavor remains covered for the e2b README. There is no test covering the JS
/* */flavor used bypackages/runtime/src/sandbox-providers/registry.tsin the fixture, nor an assertion that the doc file stays in MDX flavor (e.g. a check thatdocs/cli/**fixtures don't regress to<!-- -->). Low risk, but a cheap guard would prevent re-introducing HTML comments into the MDX-compiled tree.
Observations
- The
{/* … */}flavor means the marker is invisible when the doc is rendered as MDX, which is the point — but note plain markdown viewers show the literal braces. Since onlydocs/cli/needs it, that's fine; the rationale comment in the script is clear. - No sensitive paths touched (no migrations/auth/security/workflows/env files).
Verdict
LGTM ✅ — small, well-reasoned script/docs fix with tests passing and no package bumps required.
🤖 @agentproto-bot — review · session sess_488e48ac (agent-step:opencode) · opencode / api-key · model openrouter/z-ai/glm-5.3-flash · $0.0035 · run 34606613162 · sha 1baf71385ff6f5bf88a84189b52899658f7c7c67
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.
What
The two
sync-templatesmarkers indocs/cli/guides/sandbox-rendezvous.mdmove from the HTML comment form to the MDX one, andscripts/sync-templates.mjslearns to read that flavor.Why
cli.agentproto.shmirrorsdocs/cli/intocontent/docs/(cli-site/scripts/sync-content.mjs, renaming.md→.mdx) and compiles it with fumadocs-mdx. MDX has no HTML comments — it reads<as a JSX tag open — so those two markers are a hard parse error downstream:This has failed every production build of
agentproto/cli-sitesince 2026-07-12 — the last green run on that repo'smain. Every open PR there fails identically, including copy-only ones (agentproto/cli-site#10) and the eslint migration (agentproto/cli-site#11): it is content drift from here, not anything in those branches.It survived two months because the content lives here and the MDX compiler runs there, and the error names
content/docs/guides/sandbox-rendezvous.mdx— a build artifact, in neither repo's git tree.sync-content.mjsalready rewrites<https://…>autolinks for exactly this reason (itsmdToMdxpass). HTML comments were the gap in that safety net.The sync-templates change
sync-templates.mjsalready spoke two marker flavors —<!-- … -->for markdown,/* … */for.ts. This adds{/* … */}as a third alternative in the same regex, so it is a new spelling rather than a new mechanism, and every marked file keeps the flavor its own parser wants:packages/sandbox-e2b/README.md<!-- … -->packages/runtime/src/**.ts/* … */docs/cli/guides/sandbox-rendezvous.md{/* … */}The test fixture now writes the docs file with
{/* … */}, so all three flavors are exercised by the existing round-trip tests rather than by a new one.Verified
And against a sibling checkout of
agentproto/cli-siteatmain(3fa6112), with this branch as the content source:Before this change the same command failed at the error above.
I also compiled every file under
docs/cli/through@mdx-js/mdx. Two others fail on their own —README.md:12andconcepts/adapters.md:162, both<https://…>autolinks — butsync-content.mjsrewrites those to[url](url)during the sync, so they compile fine as shipped. Scanning the syncedcontent/docs/tree (what fumadocs actually sees) shows zero failures after this change. Left them alone rather than widening the diff; if you'd rather they not depend on the downstream rewrite, happy to fix them in a follow-up.Not in scope
agentproto/cli-siteneeds no change. Its next build picks up the fixed doc through the normalsync-contentclone.