Conversation
Code Review: Add WebMCP Tool ExposureOverview: This PR adds Security ConcernsDraft/pending episodes embedded in every page (medium severity) // Consider filtering at build time so drafts never reach the browser:
const episodes = posts
.filter((post) => post.data.status === "published") // or allow "pending" explicitly
.map<EpisodeToolData>(...)If draft content is intentionally confidential, pre-filter it in the Astro frontmatter before serializing.
Performance ConsiderationsAll episode data inlined on every page A few options to consider:
Code Quality
episode.slug === input.slug // if input.slug was used to derive `id`, this overlaps with the third check
episode.slug === `/posts/${id}`When
Minor / Conventions
Summary
The implementation is well-thought-out. The draft episode exposure and bundle size are the two items most worth deciding on before merge. Everything else is polish. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb43cd3a1a
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| throw new Error("Episode not found."); | ||
| } | ||
|
|
||
| window.location.assign(episode.url); |
There was a problem hiding this comment.
Navigate openEpisode on current origin
openEpisode currently does window.location.assign(episode.url), but episode.url is precomputed from Astro.site (the canonical production domain), not the page’s runtime origin. In non-production contexts (localhost, preview deploys, staging domains), invoking this tool will jump users to production instead of navigating within the current environment, which breaks agent-assisted testing and can lose same-origin state. Use episode.slug (relative navigation) or rebuild the URL from window.location.origin at call time.
Useful? React with 👍 / 👎.
Summary
provideContext({ tools })andregisterTool(...)with abort cleanup.Testing
pnpm astro checkpnpm build