Skip to content

Workflow model tools silently cancelled due to DWS tool approval #19186

@vglafirov

Description

@vglafirov

Describe the bug

When using workflow models (Duo Workflow Service), tool calls are silently cancelled and the session hangs. Tools never execute and eventually the stream closes without any error.

Root cause

DWS has a multi-layered tool approval system with server-side privilege preapprovals. The workflow creation response shows only read_write_files and read_only_gitlab are pre-approved at the server level, while run_commands, run_mcp_tools, use_git, and read_write_gitlab are not.

The gitlab-ai-provider was missing tool_approval_for_session_enabled: true in workflow metadata, causing DWS to silently discard all client-side preapproved_tools. When DWS then required approval for non-preapproved tools, it set the workflow status to TOOL_CALL_APPROVAL_REQUIRED — a status the provider did not handle, causing the stream to hang.

Steps to reproduce

  1. Start an opencode session with a GitLab workflow model
  2. Ask it to do something that requires tool execution (e.g., read a file, run a command)
  3. Observe that tools are never executed and the session eventually hangs or completes without tool output

Expected behavior

Tools should execute normally when using workflow models.

Environment

  • opencode version: 1.3.2
  • gitlab-ai-provider: 5.3.2
  • Platform: macOS

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