Skip to content

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

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

Activity

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

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions