Skip to content

[acp-ai-provider] Add opt-out for mirrored agent tool calls (acp.acp_provider_agent_dynamic_tool) — floods hosts without provider.tools #62

Description

@shan-lvr

Environment

  • @mcpc-tech/acp-ai-provider 0.3.5 (AI SDK v6)
  • Host: opencode 1.18.20, loading the provider as a custom npm provider (follow-up to feature request: opencode support #38)
  • Agent: antigravity-acp 1.1.0 (ACP stdio server for Google's Antigravity agy CLI)

Problem

When the underlying ACP agent executes its own internal tools (shell, file edits, …), doStream mirrors that activity into the AI SDK stream as tool-input-start / tool-call / tool-result parts named acp.acp_provider_agent_dynamic_tool.

That works when the host passes tools: provider.tools to generateText/streamText. But hosts that load the provider generically — e.g. opencode's custom npm provider mechanism, which only passes provider options and has its own tool registry — never register that tool. Every internal agent action then surfaces as an invalid model tool call:

invalid [tool=acp.acp_provider_agent_dynamic_tool, error=Model tried to call unavailable
tool 'acp.acp_provider_agent_dynamic_tool'. Available tools: bash, edit, glob, grep, …]

On an agentic task this floods the transcript with dozens of these lines, and the host feeds "unavailable tool" error results back into the loop even though the agent-side work is actually proceeding fine.

Request

An opt-out (or smarter default) for the mirroring, e.g.:

  • a provider setting like mirrorAgentToolCalls?: boolean, or
  • only emit the dynamic tool parts when client tools were actually registered for the session, and emit agent tool activity as text/reasoning parts otherwise.

Workaround we use today

Wrapping the ReadableStream controller in doStream and dropping tool-call / tool-result / tool-input-* parts. The agent's text updates still stream through, and hosts stop logging invalid tool calls. Happy to open a PR for a settings-gated version of this if that direction works for you.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions