Vertex AI: BadRequestError 'instructions: Extra inputs are not permitted' when running agents #2828

Open
opened 2026-02-16 17:37:24 -05:00 by yindo · 2 comments
Owner

Originally created by @Ipolo92 on GitHub (Nov 13, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When running agents (using the Task tool) with Vertex AI (Google Cloud), OpenCode crashes with the following error:

litellm.BadRequestError: Vertex_aiException BadRequestError - b'{"type":"error","error":{"type":"invalid_request_error","message":"instructions: Extra inputs are not permitted"},"request_id":"req_vrtx_011CV5YEZHNBbDtN3P12S1cH"}'. Received Model Group=claude-sonnet-4-5 Available Model Group Fallbacks=None

Configuration

{
    "provider": "vertex",
    "vertexProjectId": "<my-project-id>",
    "vertexRegion": "europe-west1",
    "model": "claude-sonnet-4-5@20250514"
}

Root Cause

Vertex AI's Anthropic API implementation doesn't support the instructions parameter that LiteLLM is trying to send when OpenCode spawns sub-agents via the Task tool. This is similar to issue #2038 which occurred with Bedrock.

The main OpenCode agent works fine, but whenever a sub-agent is created (e.g., when using the Task tool), the request includes an instructions field that Vertex AI rejects.

Expected Behavior

Agents should work seamlessly with Vertex AI just like the main OpenCode instance does.

Actual Behavior

Sub-agents fail immediately with the "Extra inputs are not permitted" error, causing OpenCode to crash.

Environment

  • Provider: Google Vertex AI
  • Model: claude-sonnet-4-5@20250514
  • Region: europe-west1
  • OpenCode version: Latest (as of Nov 2025) => 1.0.62

Suggested Fix

Similar to how the main agent request is formatted for Vertex AI compatibility, sub-agent requests should also avoid sending unsupported parameters like instructions when using Vertex AI as the provider.

Originally created by @Ipolo92 on GitHub (Nov 13, 2025). Originally assigned to: @rekram1-node on GitHub. ## Description When running agents (using the Task tool) with Vertex AI (Google Cloud), OpenCode crashes with the following error: ``` litellm.BadRequestError: Vertex_aiException BadRequestError - b'{"type":"error","error":{"type":"invalid_request_error","message":"instructions: Extra inputs are not permitted"},"request_id":"req_vrtx_011CV5YEZHNBbDtN3P12S1cH"}'. Received Model Group=claude-sonnet-4-5 Available Model Group Fallbacks=None ``` ## Configuration ```json { "provider": "vertex", "vertexProjectId": "<my-project-id>", "vertexRegion": "europe-west1", "model": "claude-sonnet-4-5@20250514" } ``` ## Root Cause Vertex AI's Anthropic API implementation doesn't support the `instructions` parameter that LiteLLM is trying to send when OpenCode spawns sub-agents via the Task tool. This is similar to issue #2038 which occurred with Bedrock. The main OpenCode agent works fine, but whenever a sub-agent is created (e.g., when using the Task tool), the request includes an `instructions` field that Vertex AI rejects. ## Expected Behavior Agents should work seamlessly with Vertex AI just like the main OpenCode instance does. ## Actual Behavior Sub-agents fail immediately with the "Extra inputs are not permitted" error, causing OpenCode to crash. ## Environment - Provider: Google Vertex AI - Model: claude-sonnet-4-5@20250514 - Region: europe-west1 - OpenCode version: Latest (as of Nov 2025) => `1.0.62` ## Suggested Fix Similar to how the main agent request is formatted for Vertex AI compatibility, sub-agent requests should also avoid sending unsupported parameters like `instructions` when using Vertex AI as the provider.
yindo added the bug label 2026-02-16 17:37:24 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 13, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2038: Similar "Extra inputs are not permitted" error with Bedrock when using Task tool/sub-agents - the root cause appears to be that sub-agents receive additional parameters (like 'instructions') that certain providers (Bedrock, Vertex AI) don't support

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 13, 2025): This issue might be a duplicate of existing issues. Please check: - #2038: Similar "Extra inputs are not permitted" error with Bedrock when using Task tool/sub-agents - the root cause appears to be that sub-agents receive additional parameters (like 'instructions') that certain providers (Bedrock, Vertex AI) don't support Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 13, 2025):

@Ipolo92 is that instructions field being sent because you have it defined in an agents definition?

@rekram1-node commented on GitHub (Nov 13, 2025): @Ipolo92 is that instructions field being sent because you have it defined in an agents definition?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2828