Skip to content

test(*): cover agent rules placement, symlink, Edge, and opt-out gaps - #10471

Closed
alexcarpenter wants to merge 1 commit into
ra/write-agents.md-file-with-clerk-instructionsfrom
ra/agent-rules-review-tests
Closed

alexcarpenter wants to merge 1 commit into
ra/write-agents.md-file-with-clerk-instructionsfrom
ra/agent-rules-review-tests

Conversation

@alexcarpenter

Copy link
Copy Markdown
Member

Description

Adds tests for four gaps in #10320. Each one fails against #10320 as it stands. The fixes belong in #10320. This PR only holds the tests so they can be reviewed together, so CI on this branch is expected to fail until the fixes land.

  • Pointer in pnpm monorepos (agentRules.spec.ts). The writer puts the block in the workspace root AGENTS.md, which points to node_modules/@clerk/<sdk>/AGENTS.md. pnpm installs the SDK under the app's own node_modules (for example apps/web/node_modules), not the root, so the pointer does not resolve. Next.js avoids this by writing AGENTS.md in the app directory. The existing test targets the workspace root when one exists asserts the current behavior and will need to change with the fix.
  • Dangling CLAUDE.md symlink (agentRules.spec.ts). When CLAUDE.md links to an AGENTS.md that does not exist yet, the writer writes the Clerk block, then writes @AGENTS.md through the link and replaces it. The first run leaves only a self-import. The in-memory fs in the spec now models symlinks for this.
  • Edge runtime warning (agent-rules-node.test.ts). On Edge, #safe-node-apis resolves to the browser stub, where cwd is undefined. nodeCwdOrThrow() throws inside the try and the SDK logs "Could not update AGENTS.md" on a dev middleware run, even though nothing is wrong. The test expects a silent skip. Not reproduced in a running Next.js app.
  • Opt-out with whitespace (runtimeEnvironment.spec.ts). CLERK_AGENTS_MD=" false" is not trimmed, so the opt-out is ignored.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Oct 27, 2026 8:28pm UTC
swingset Ready Ready Preview Oct 27, 2026 8:28pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fb3e975

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@alexcarpenter

Copy link
Copy Markdown
Member Author

Closing; opened too early. Moving this back to local review.

This branch was successfully deployed

2 active deployments
Preview – swingset — fb3e9752 Deployed Oct 27, 2026 by vercel[bot]
Preview – clerk-js-sandbox — fb3e9752 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants