Skip to content

fix: 🤖 attempt fix for issue #583#585

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

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

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Automated fix attempt

Fixes #583

Source issue: #583

Summary

All changes are consistent and correct.

Summary

Root cause: In gateway.ts, the createAccess handler silently defaulted type to "Event" when omitted ((input.type || "Event")). For HTTP functions, this produced a gateway access entry with the wrong type, causing all subsequent gateway requests to fail with FUNCTION_PARAM_INVALID.

Changes made (2 files, 3 edits):

  1. mcp/src/tools/gateway.ts:331-336 — Added a validation guard that rejects createAccess calls when type is missing. The error message explicitly states that type is required (Event or HTTP) and explains that omitting it causes the silent Event fallback that breaks HTTP functions.

  2. mcp/src/tools/gateway.ts:345 — Removed the "Event" fallback default from the type-to-numeric mapping. Since type is now validated as present above, the expression simplifies to input.type === "HTTP" ? 6 : 1.

  3. mcp/src/tools/functions.ts:1024-1029 — Strengthened the createAccess nextAction guidance returned after HTTP function creation. The reason now explicitly instructs the caller to pass type="HTTP", targetType="function", and the function name, and warns that type must not be omitted.

  4. mcp/src/tools/gateway.ts:352 — Minor consistency fix: removed "或省略" from the error hint text since omitting type is no longer allowed.

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.

fix(gateway): prevent silent Event fallback when exposing HTTP functions

0 participants