Skip to content

fix: 🤖 attempt fix for issue #568#570

Open
github-actions[bot] wants to merge 1 commit intomainfrom
ai-fix/issue-568
Open

fix: 🤖 attempt fix for issue #568#570
github-actions[bot] wants to merge 1 commit intomainfrom
ai-fix/issue-568

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Automated fix attempt

Fixes #568

Source issue: #568

Summary

All changes look correct. Let me also check the Claude skills mirror to see if it needs updating (per the rules, it's auto-synced, so I shouldn't edit it directly).

The changes are complete. Here's a summary:

Summary

Issue: Agents passed the project root as functionRootPath (e.g., /home/user/project) instead of the cloudfunctions or functions directory (e.g., /home/user/project/cloudfunctions), causing the evaluator to fail because it expected code at cloudfunctions/hello/index.js not hello/index.js.

Changes made (4 files):

  1. mcp/src/tools/functions.ts (main fix):

    • Schema description (line ~1453): Rewrote functionRootPath description to explicitly say it must be the directory that directly contains function folders (like cloudfunctions or functions), and to NOT pass the project root or the function subdirectory itself. Previously it only warned about the function subdirectory, not the project root.
    • Error guidance (buildFunctionOperationErrorMessage, line ~372): Added logic that detects when functionRootPath doesn't end with cloudfunctions or functions and suggests the correct path (e.g., /project/cloudfunctions or /project/functions).
    • Error messages (lines ~389, ~897): Updated paths[0] and HTTP function error hints to say "cloudfunctions 或 functions 目录的绝对路径,不是项目根目录" instead of the ambiguous "cloudfunctions 父目录".
  2. mcp/src/tools/functions.test.ts: Added two regression tests:

    • Verifies the project-root warning appears when functionRootPath doesn't end with cloudfunctions/functions on path-not-found errors.
    • Verifies no spurious warning when functionRootPath already correctly ends with cloudfunctions.
  3. config/source/skills/cloud-functions/SKILL.md: Updated the functionRootPath guidance to say "directory that directly contains function folders (e.g., cloudfunctions/ or functions/), NOT the project root and NOT the function subdirectory itself".

  4. doc/mcp-tools.md: Updated the generated docs table row for functionRootPath to match the new schema description.

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.

Clarify manageFunctions functionRootPath should target cloudfunctions/functions dir, not project root

0 participants