René's URL Explorer Experiment


Title: fix: make AI-built anchor links work and publish results accurate by ysamcode · Pull Request #606 · ycode/ycode · GitHub

Open Graph Title: fix: make AI-built anchor links work and publish results accurate by ysamcode · Pull Request #606 · ycode/ycode

X Title: fix: make AI-built anchor links work and publish results accurate by ysamcode · Pull Request #606 · ycode/ycode

Description: Summary Fix MCP issues found while building a one-page template: in-page anchor links set by AI agents never rendered, the publish result reported pages: 0 for layer edits that did go live, export_layer_html dropped links, and an unknown page id looked like an empty page. Also adds the hook the hosted MCP hub needs for a per-call site_id. Changes Treat a url link with only anchor_layer_id as valid, so same-page anchors render as href="#id" instead of being dropped Resolve anchors through the element id the renderer actually emits (settings.id, then attributes.id); previously only attributes.id was mapped, so ids set in the builder or over MCP never matched a stored layer id update_layer_link and the batch update_link op store the target's HTML id (what the builder stores) and return a clear error when the target has none; batch ops accept a ref_id as the anchor MCP publish counts pages whose layers changed, not just page-setting changes export_layer_html renders every link type with the published href and keeps element ids Unknown page ids now error ("does not exist on this site") instead of returning [] and "Layer not found" Key the MCP page-layer cache by tenant so a multi-tenant process never serves another site's cached tree Add sharedToolParams to createMcpServer: hosts can add per-call params to every built-in tool; they are stripped before handlers run Tool descriptions: batch limit (max 50 ops), anchor setup, and that the first request after publishing can still be cached Note: the report that update_layer_link doesn't mark a page as unpublished did not reproduce — the page shows as modified and publish takes it live; the pages: 0 count and the unrendered anchor links made it look that way. Test plan Over MCP: update_layer_settings html_id: "works" on a section, then update_layer_link with link_type: "url" and anchor_layer_id = the section's layer id — published page has Same call on a section without an HTML id returns an error suggesting html_id In the builder, an existing anchor link (link settings → anchor) still scrolls to its section Edit one layer's link, then publish — changes.pages is 1 export_layer_html on a section with page, anchor and email links shows the hrefs get_layers with a made-up page id returns the "does not exist on this site" error npm test passes

Open Graph Description: Summary Fix MCP issues found while building a one-page template: in-page anchor links set by AI agents never rendered, the publish result reported pages: 0 for layer edits that did go live, export_...

X Description: Summary Fix MCP issues found while building a one-page template: in-page anchor links set by AI agents never rendered, the publish result reported pages: 0 for layer edits that did go live, export_...

Opengraph URL: https://github.com/ycode/ycode/pull/606

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b63f4328-f877-e951-d21a-9922fc092bf9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE23E:31DB85:231FBF:2DB237:6AFE4A0F
html-safe-nonce01e91755ca8ebd6358c9c05151954f460391b69f625635690f115866985e508c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjNFOjMxREI4NToyMzFGQkY6MkRCMjM3OjZBRkU0QTBGIiwidmlzaXRvcl9pZCI6IjE3MTUwOTk5MjkwNzgwMjQ3MTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac309f1e2cdfcd59fdbb9f9332d3d2a650b5ba9f2b298ae32b83d58ac8d4049ae1
hovercard-subject-tagpull_request:4802903368
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/ycode/ycode/pull/606/files
twitter:imagehttps://avatars.githubusercontent.com/u/7631193?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/7631193?s=400&v=4
og:image:altSummary Fix MCP issues found while building a one-page template: in-page anchor links set by AI agents never rendered, the publish result reported pages: 0 for layer edits that did go live, export_...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef1a5901e2377b0af2a0b303f9528678f1475d04b9219dca1e993344196eaa07c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/ycode/ycode git https://github.com/ycode/ycode.git
octolytics-dimension-user_id65892203
octolytics-dimension-user_loginycode
octolytics-dimension-repository_id1165452593
octolytics-dimension-repository_nwoycode/ycode
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1165452593
octolytics-dimension-repository_network_root_nwoycode/ycode
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasece393ea11ad276623b946bc9663d3e7d6f564275
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/ycode/ycode/pull/606/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fycode%2Fycode%2Fpull%2F606%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fycode%2Fycode%2Fpull%2F606%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=ycode%2Fycode
Reloadhttps://github.com/ycode/ycode/pull/606/files
Reloadhttps://github.com/ycode/ycode/pull/606/files
Reloadhttps://github.com/ycode/ycode/pull/606/files
ycodehttps://github.com/ycode
ycodehttps://github.com/ycode/ycode
Codehttps://github.com/ycode/ycode
Issues7 (7)https://github.com/ycode/ycode/issues
Pull requests1 (1)https://github.com/ycode/ycode/pulls
Discussionshttps://github.com/ycode/ycode/discussions
Actionshttps://github.com/ycode/ycode/actions
Projectshttps://github.com/ycode/ycode/projects
Security and quality1 (1)https://github.com/ycode/ycode/security
Insightshttps://github.com/ycode/ycode/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fycode%2Fycode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fycode%2Fycode%2Fissues%2Fnew%2Fchoose
ysamcodehttps://github.com/ysamcode
develophttps://github.com/ycode/ycode/tree/develop
fix/mcp-links-publish-siteshttps://github.com/ycode/ycode/tree/fix/mcp-links-publish-sites
Conversation 0 https://github.com/ycode/ycode/pull/606
Commits 1 https://github.com/ycode/ycode/pull/606/commits
Checks 0 https://github.com/ycode/ycode/pull/606/checks
Files changed https://github.com/ycode/ycode/pull/606/files
Please reload this pagehttps://github.com/ycode/ycode/pull/606/files
fix: make AI-built anchor links work and publish results accurate https://github.com/ycode/ycode/pull/606/files#top
Show all changes 1 commit https://github.com/ycode/ycode/pull/606/files
69748f5 fix: repair MCP anchor links and publish counts ysamcode Oct 9, 2026 https://github.com/ycode/ycode/pull/606/commits/69748f588154f6a5959fc0b00cdc8bd8a895a2a9
Clear filters https://github.com/ycode/ycode/pull/606/files
Please reload this pagehttps://github.com/ycode/ycode/pull/606/files
Please reload this pagehttps://github.com/ycode/ycode/pull/606/files
LayerRenderer.tsx https://github.com/ycode/ycode/pull/606/files#diff-3533cf1930345e3393481c3bdade5396e611e5a4ae915db5b4dd59b9f1fbbe0a
html-layer-converter.ts https://github.com/ycode/ycode/pull/606/files#diff-75f6f2f667137f4e6f1a0b801e296a41b18c8a8b9ba4453eb2d4758372c2dad2
layer-export-html.test.ts https://github.com/ycode/ycode/pull/606/files#diff-c874e4fe5a1444072f5d3c71378b565c9efc3cf5540fdc5fb4161c71ae3a2616
link-utils.ts https://github.com/ycode/ycode/pull/606/files#diff-3be163fc3672481f29209957f4a535eeebf2d0fd49c78115f857f86b95fb07ae
link-anchor.test.ts https://github.com/ycode/ycode/pull/606/files#diff-94d08b06c8faef2275f2e92bfc25457454a22dc734c662f3bd4fba5ad6b1326d
page-layers.ts https://github.com/ycode/ycode/pull/606/files#diff-dd3c266f3e926fa120dded56de2b8fab5daba5be3e72b4a0db8d788cc0a2aac7
server.ts https://github.com/ycode/ycode/pull/606/files#diff-0aff676e32464b22c6c99b94d4955ed161889ecb0ef26b273eb4712a2180245e
tool-annotations.test.ts https://github.com/ycode/ycode/pull/606/files#diff-dcf88b712a9d5ecad191edcdc8a2bea8f7d0a690ef30f17a641deeec8a34a0d3
tool-annotations.ts https://github.com/ycode/ycode/pull/606/files#diff-60103ed71bcd6e529b9c8ccd496be887facb484dbbe1ab2b2faa368303219bb6
batch.ts https://github.com/ycode/ycode/pull/606/files#diff-7094f3dd81bf3528c5e6887a1e25562cddaf5d09c39fc92117415adc31bf45f7
layers.ts https://github.com/ycode/ycode/pull/606/files#diff-28b20a5a644175adbc53624b91e5c2d281857283b1d16c1dc6b44ddbe5701a1c
publishing.ts https://github.com/ycode/ycode/pull/606/files#diff-5218978b06c79cb6fd6dc9ac7f87ee185808ae8994043dbfde8f0291eec841cb
shared-schemas.ts https://github.com/ycode/ycode/pull/606/files#diff-6df1e7c3ec69fa07b3390ae988e8439597189b95c31ca6c2ede29cb2aeeaedb8
utils.ts https://github.com/ycode/ycode/pull/606/files#diff-bd8a32917b030985a1336c035b58eb7c1c4cc90f5c1a63544c288668cb69a3a4
page-fetcher.ts https://github.com/ycode/ycode/pull/606/files#diff-28e0b23fdbe1ae4953b860f3213a935ad8d5a4c9102c3ac6180a859ae29b3f99
package.json https://github.com/ycode/ycode/pull/606/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
components/LayerRenderer.tsxhttps://github.com/ycode/ycode/pull/606/files#diff-3533cf1930345e3393481c3bdade5396e611e5a4ae915db5b4dd59b9f1fbbe0a
View file https://github.com/ycode/ycode/blob/69748f588154f6a5959fc0b00cdc8bd8a895a2a9/components/LayerRenderer.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/606/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/606/files#diff-3533cf1930345e3393481c3bdade5396e611e5a4ae915db5b4dd59b9f1fbbe0a
https://github.com/ycode/ycode/pull/606/files#diff-3533cf1930345e3393481c3bdade5396e611e5a4ae915db5b4dd59b9f1fbbe0a
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/html-layer-converter.tshttps://github.com/ycode/ycode/pull/606/files#diff-75f6f2f667137f4e6f1a0b801e296a41b18c8a8b9ba4453eb2d4758372c2dad2
View file https://github.com/ycode/ycode/blob/69748f588154f6a5959fc0b00cdc8bd8a895a2a9/lib/html-layer-converter.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/606/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/606/files#diff-75f6f2f667137f4e6f1a0b801e296a41b18c8a8b9ba4453eb2d4758372c2dad2
https://github.com/ycode/ycode/pull/606/files#diff-75f6f2f667137f4e6f1a0b801e296a41b18c8a8b9ba4453eb2d4758372c2dad2
https://github.com/ycode/ycode/pull/606/files#diff-75f6f2f667137f4e6f1a0b801e296a41b18c8a8b9ba4453eb2d4758372c2dad2
https://github.com/ycode/ycode/pull/606/files#diff-75f6f2f667137f4e6f1a0b801e296a41b18c8a8b9ba4453eb2d4758372c2dad2
https://github.com/ycode/ycode/pull/606/files#diff-75f6f2f667137f4e6f1a0b801e296a41b18c8a8b9ba4453eb2d4758372c2dad2
https://github.com/ycode/ycode/pull/606/files#diff-75f6f2f667137f4e6f1a0b801e296a41b18c8a8b9ba4453eb2d4758372c2dad2
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/layer-export-html.test.tshttps://github.com/ycode/ycode/pull/606/files#diff-c874e4fe5a1444072f5d3c71378b565c9efc3cf5540fdc5fb4161c71ae3a2616
View file https://github.com/ycode/ycode/blob/69748f588154f6a5959fc0b00cdc8bd8a895a2a9/lib/layer-export-html.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/606/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/606/files#diff-c874e4fe5a1444072f5d3c71378b565c9efc3cf5540fdc5fb4161c71ae3a2616
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/link-utils.tshttps://github.com/ycode/ycode/pull/606/files#diff-3be163fc3672481f29209957f4a535eeebf2d0fd49c78115f857f86b95fb07ae
View file https://github.com/ycode/ycode/blob/69748f588154f6a5959fc0b00cdc8bd8a895a2a9/lib/link-utils.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/606/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/606/files#diff-3be163fc3672481f29209957f4a535eeebf2d0fd49c78115f857f86b95fb07ae
https://github.com/ycode/ycode/pull/606/files#diff-3be163fc3672481f29209957f4a535eeebf2d0fd49c78115f857f86b95fb07ae
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/mcp/link-anchor.test.tshttps://github.com/ycode/ycode/pull/606/files#diff-94d08b06c8faef2275f2e92bfc25457454a22dc734c662f3bd4fba5ad6b1326d
View file https://github.com/ycode/ycode/blob/69748f588154f6a5959fc0b00cdc8bd8a895a2a9/lib/mcp/link-anchor.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/606/{{ revealButtonHref }}
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/mcp/page-layers.tshttps://github.com/ycode/ycode/pull/606/files#diff-dd3c266f3e926fa120dded56de2b8fab5daba5be3e72b4a0db8d788cc0a2aac7
View file https://github.com/ycode/ycode/blob/69748f588154f6a5959fc0b00cdc8bd8a895a2a9/lib/mcp/page-layers.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/606/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/606/files#diff-dd3c266f3e926fa120dded56de2b8fab5daba5be3e72b4a0db8d788cc0a2aac7
https://github.com/ycode/ycode/pull/606/files#diff-dd3c266f3e926fa120dded56de2b8fab5daba5be3e72b4a0db8d788cc0a2aac7
https://github.com/ycode/ycode/pull/606/files#diff-dd3c266f3e926fa120dded56de2b8fab5daba5be3e72b4a0db8d788cc0a2aac7
https://github.com/ycode/ycode/pull/606/files#diff-dd3c266f3e926fa120dded56de2b8fab5daba5be3e72b4a0db8d788cc0a2aac7
https://github.com/ycode/ycode/pull/606/files#diff-dd3c266f3e926fa120dded56de2b8fab5daba5be3e72b4a0db8d788cc0a2aac7
Please reload this pagehttps://github.com/ycode/ycode/pull/606/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.