Skip to content

layers_split uses Gemini even when provider=mock in MCP #11

@iamliuhaitian-coder

Description

@iamliuhaitian-coder

Bug: layers_split ignores provider=mock and still calls Gemini during analyze stage

Summary

When calling layers_split via MCP with provider="mock", the tool still attempts a Gemini API call in layer analysis, causing failure in offline/no-key environments.

Environment

  • OS: macOS Darwin 21.1.0 (arm64)
  • Vulca MCP command: /Users/liuhaitian/Documents/PHD/2026/upgrade/vulca/.venv/bin/vulca-mcp
  • FastMCP client: fastmcp 3.2.4
  • Invocation mode: MCP stdio

Reproduction

  1. Configure MCP server vulca.
  2. Run:
    • view_image(image_path=".../theory-materiality-practice-diagram.png") (works)
  3. Run:
    • layers_split(image_path=".../theory-materiality-practice-diagram.png", output_dir=".../vulca_mcp_demo_layers", mode="sam", provider="mock", tradition="default")

Expected behavior

  • With provider="mock", the whole layers_split pipeline should avoid Gemini dependencies.
  • In no-network/no-key setups, either:
    • complete successfully using mock/local path, or
    • fail fast with a clear message that provider=mock is not supported for analyze stage.

Actual behavior

  • Tool retries Gemini calls and fails with:
    • litellm.APIConnectionError (offline)
    • litellm.AuthenticationError (API_KEY_INVALID) when network is available but key invalid
  • Output indicates failures in layers.analyze before split output is produced.

Evidence (trimmed)

Layer analysis failed after 3 attempts: litellm.AuthenticationError: GeminiException ... API_KEY_INVALID

Impact

  • Breaks minimal/local-first MCP workflow for decomposition.
  • provider semantics are unclear/inconsistent from user perspective.

Suggested fix

  • Ensure layers_split(..., provider="mock") passes provider choice through analysis stage.
  • Add explicit provider capability matrix in MCP tool docs/response.
  • Return structured error with actionable remediation (missing_api_key, provider_not_supported, etc.) instead of generic pipeline failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions