-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
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
- Start an opencode session with a GitLab workflow model
- Ask it to do something that requires tool execution (e.g., read a file, run a command)
- 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