Skip to content

manageFunctions should fail fast on HTTP function handler/bootstrap ambiguity #571

@binggg

Description

@binggg

Signal

  • Attribution: issue_mo4l8gm6_eo47c5
  • Run: atomic-js-cloudbase-http-function-deploy/2026-04-18T17-50-40-d31a25
  • Score / failure: overall 0.459; 4/7 checks failed; deployed http function returned FUNCTION_EXECUTE_FAIL on /, /health, POST /, and 404 path

Why this is actionable

  • Relevant module: mcp/src/tools/functions.ts (manageFunctions createFunction contract for HTTP functions)
  • Current behavior: manageFunctions accepts HTTP createFunction calls with Event-style handler input and only reports success after upload. It does not fail fast on HTTP-specific packaging/entrypoint mismatches, so the agent can ship code that deploys but crashes at runtime.
  • Evidence: the representative trace created an HTTP function with func.handler="index.main" and a scf_bootstrap that started node index.js. The local index.js was a port-9000 server, but the deployed function still failed at runtime with FUNCTION_EXECUTE_FAIL, which means the current contract leaves ambiguous HTTP startup semantics unguarded.
  • Expected behavior: for HTTP functions, the tool contract should explicitly steer the agent away from Event-style handler usage and fail fast on dangerous HTTP bootstrap/entrypoint ambiguity before a broken deployment is reported as success.

Proposed direction

  • Tighten the HTTP createFunction contract in mcp/src/tools/functions.ts: make handler guidance explicit for HTTP functions and add fail-fast validation for HTTP handler/bootstrap ambiguity.
  • Add regression tests for the new HTTP validation and rebuild generated tool docs/artifacts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-fixAI automation created a fix PR for this issueai-processedAI automation already processed this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions