Skip to content

fix(convex-mcp): resolve the Convex functions directory from convex.json - #625

Merged
HomenShum merged 2 commits into
mainfrom
fix/convex-mcp-project-resolver-20260911
Sep 11, 2026
Merged

fix(convex-mcp): resolve the Convex functions directory from convex.json#625
HomenShum merged 2 commits into
mainfrom
fix/convex-mcp-project-resolver-20260911

Conversation

@HomenShum

Copy link
Copy Markdown
Owner

A maintainer reading the nightly Convex MCP Eval Gate sees it red every night (run 34560628757 and every scheduled run since the backend moved). Four tools.test.ts cases fail with No convex/ directory found because PR #590 relocated the backend to backend/convex/ (root convex.json = {"functions": "backend/convex/"}), schemaTools.ts kept a copy-pasted resolver that only probes convex/ and src/convex, and the single-file architect test hard-codes resolve(PROJECT_DIR, "convex", "schema.ts").

Fix at the root: one shared src/project.ts resolver that honors convex.json's functions path (bounded read, invalid config → null, never a stale guess), with convex/, src/convex, backend/convex as fallbacks; all 19 tool files import it instead of carrying their own copy; the test derives the schema path from it; a projectResolution.test.ts unit test pins the behaviour. The real-backend convex_audit_functions test gets the same 30 s budget the neighbouring repo-scan tests already use (it scans the whole backend tree).

Carved out of draft #621, which bundles this with ~1.3k unrelated typing changes and currently fails Typecheck. Local: npm run build clean, vitest 80/80.

Not changed: the workflow's failure behaviour, any tool output contract other than the error text when no functions directory is configured.

🤖 Generated with Claude Code

The nightly Convex MCP Eval Gate has failed since PR #590 moved the Convex
backend from convex/ to backend/convex/ and left a root convex.json pointing at
it: four tools.test.ts cases reported "No convex/ directory found" because
schemaTools kept a copy-pasted resolver that only probes convex/ and src/convex,
and the single-file architect test hard-coded resolve(PROJECT_DIR, "convex").

Give the package one shared resolver (src/project.ts) that honors the
convex.json "functions" path, falls back to convex/, src/convex, backend/convex,
and returns null for an invalid config instead of a stale guess; import it from
all 19 tool files that carried their own copy; make the test derive the schema
path from it; and add the resolver unit test. The real-backend audit test gets
the same 30s budget the neighbouring repo-scan tests already use.

Carved out of draft PR #621 (which also carries ~1.3k unrelated typing
changes). No workflow behaviour changed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
nodebench-ai Ignored Ignored Preview Sep 11, 2026 8:54am UTC

Request Review

@HomenShum
HomenShum merged commit 0afa46c into main Sep 11, 2026
15 checks passed
@HomenShum
HomenShum deleted the fix/convex-mcp-project-resolver-20260911 branch September 11, 2026 09:01
@github-actions

Copy link
Copy Markdown

Demo: walkthrough of the surfaces this PR changed is available as a workflow artifact (pr-demo-625) at https://github.com/HomenShum/NodeBenchAI/actions/runs/34582048728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants