Skip to content

sdk.prompt({ tools }) does not override agent configured permissions #17063

@jquense

Description

@jquense

Description

When using the SDK, session.prompt({ tools: { question: true } }) does not expose the tool to the model if the selected agent has permission: {}. I believe this is true for any permission that is denied by the agent

Plugins

none

OpenCode version

1.2.24

Steps to reproduce

  1. Configure an agent like this:
{
  "agent": {
    "repro": {
      "mode": "primary",
      "model": "anthropic/claude-sonnet-4-5-20250929",
      "permission": {}
    }
  }
}
  1. Create a session through the SDK
  2. Call session.prompt() with:
{
  sessionID,
  agent: "repro",
  tools: { question: true },
  parts: [
    { type: "text", text: "do you have a question tool?" }
  ]
}
  1. Observe the model response

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions