Azure Devops Pipeline #7774

Open
opened 2026-02-16 18:08:12 -05:00 by yindo · 2 comments
Owner

Originally created by @sschuetz2bit on GitHub (Jan 27, 2026).

Originally assigned to: @rekram1-node on GitHub.

Question

We are currently trying to get opencode to run in a Azure Devops Pipeline:

`trigger: none

pr:
branches:
include:
- "*"

pool:
vmImage: ubuntu-latest

steps:

  • checkout: self
    fetchDepth: 0
    persistCredentials: true

  • bash: |
    set -euo pipefail
    curl -fsSL https://opencode.ai/install | bash
    OPENCODE="$HOME/.opencode/bin/opencode"
    echo "##vso[task.prependpath]$(dirname "$OPENCODE")"
    "$OPENCODE" --version
    displayName: "Install OpenCode"

  • bash: |
    opencode run -m "$OPENCODE_MODEL" -- "Say hello"
    displayName: "Generate PR Review"
    env:
    AZURE_RESOURCE_NAME: $(AZURE_RESOURCE_NAME)
    AZURE_API_KEY: $(AZURE_API_KEY)
    OPENCODE_MODEL: "azure/gpt-5.1-codex-mini"
    `

However opencode just gets stuck, does not log anything nor does it run.

The api key, model and resource_name are correct. when trying it locally it runs.

here is the log output:
`2026-01-27T20:03:46.3522991Z ##[section]Starting: Install OpenCode
2026-01-27T20:03:46.3531769Z ==============================================================================
2026-01-27T20:03:46.3531953Z Task : Bash
2026-01-27T20:03:46.3532054Z Description : Run a Bash script on macOS, Linux, or Windows
2026-01-27T20:03:46.3532186Z Version : 3.259.0
2026-01-27T20:03:46.3532295Z Author : Microsoft Corporation
2026-01-27T20:03:46.3532410Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2026-01-27T20:03:46.3532558Z ==============================================================================
2026-01-27T20:03:46.5980283Z Generating script.
2026-01-27T20:03:46.5992105Z ========================== Starting Command Output ===========================
2026-01-27T20:03:46.6000280Z [command]/usr/bin/bash /home/vsts/work/_temp/46883133-f9d6-4cb8-9424-84b62270df7d.sh
2026-01-27T20:03:47.1910981Z 
2026-01-27T20:03:47.1912107Z Installing opencode version: 1.1.36
2026-01-27T20:03:47.5704686Z #=#=#
2026-01-27T20:03:47.6741685Z ##O#-#
2026-01-27T20:03:47.6743029Z
2026-01-27T20:03:47.7757716Z ##################################### 52.3%
2026-01-27T20:03:47.8750552Z ############################################################ 83.9%
2026-01-27T20:03:47.9531172Z ############################################################## 86.3%
2026-01-27T20:03:47.9532683Z ######################################################################## 100.0%
2026-01-27T20:03:49.2086828Z Successfully added opencode to $PATH in /home/vsts/.bashrc
2026-01-27T20:03:49.2088256Z
2026-01-27T20:03:49.2089658Z   ▄
2026-01-27T20:03:49.2100277Z █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
2026-01-27T20:03:49.2102162Z █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
2026-01-27T20:03:49.2103757Z ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀
2026-01-27T20:03:49.2104598Z
2026-01-27T20:03:49.2105155Z
2026-01-27T20:03:49.2106380Z OpenCode includes free models, to start:
2026-01-27T20:03:49.2106790Z
2026-01-27T20:03:49.2107602Z cd # Open directory
2026-01-27T20:03:49.2108481Z opencode # Run command
2026-01-27T20:03:49.2108818Z
2026-01-27T20:03:49.2109710Z For more information visit https://opencode.ai/docs
2026-01-27T20:03:49.2110139Z
2026-01-27T20:03:49.2110469Z
2026-01-27T20:03:49.7985938Z INFO 2026-01-27T20:03:49 +124ms service=models.dev file={} refreshing
2026-01-27T20:03:50.0606040Z 1.1.36
2026-01-27T20:03:50.0787579Z
2026-01-27T20:03:50.0857711Z ##[section]Finishing: Install OpenCode

2026-01-27T20:14:25.4946801Z ##[section]Starting: Generate PR Review
2026-01-27T20:14:25.4953921Z ==============================================================================
2026-01-27T20:14:25.4954051Z Task : Bash
2026-01-27T20:14:25.4954124Z Description : Run a Bash script on macOS, Linux, or Windows
2026-01-27T20:14:25.4954217Z Version : 3.259.0
2026-01-27T20:14:25.4954294Z Author : Microsoft Corporation
2026-01-27T20:14:25.4954374Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2026-01-27T20:14:25.4954478Z ==============================================================================
2026-01-27T20:14:25.8327001Z Generating script.
2026-01-27T20:14:25.8360113Z Script contents:
2026-01-27T20:14:25.8360806Z opencode run -m "$OPENCODE_MODEL" "Say hello"
2026-01-27T20:14:25.8361659Z ========================== Starting Command Output ===========================
2026-01-27T20:14:25.8362703Z [command]/usr/bin/bash /home/vsts/work/_temp/de9a09a9-d74a-4552-a743-4dabca2bfc76.sh
2026-01-27T20:14:26.4440769Z INFO 2026-01-27T20:14:26 +121ms service=models.dev file={} refreshing
`

how can i debug it?
It runs perfectly fine on my machine in bash

Originally created by @sschuetz2bit on GitHub (Jan 27, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question We are currently trying to get opencode to run in a Azure Devops Pipeline: `trigger: none pr: branches: include: - "*" pool: vmImage: ubuntu-latest steps: - checkout: self fetchDepth: 0 persistCredentials: true - bash: | set -euo pipefail curl -fsSL https://opencode.ai/install | bash OPENCODE="$HOME/.opencode/bin/opencode" echo "##vso[task.prependpath]$(dirname "$OPENCODE")" "$OPENCODE" --version displayName: "Install OpenCode" - bash: | opencode run -m "$OPENCODE_MODEL" -- "Say hello" displayName: "Generate PR Review" env: AZURE_RESOURCE_NAME: $(AZURE_RESOURCE_NAME) AZURE_API_KEY: $(AZURE_API_KEY) OPENCODE_MODEL: "azure/gpt-5.1-codex-mini" ` However opencode just gets stuck, does not log anything nor does it run. The api key, model and resource_name are correct. when trying it locally it runs. here is the log output: `2026-01-27T20:03:46.3522991Z ##[section]Starting: Install OpenCode 2026-01-27T20:03:46.3531769Z ============================================================================== 2026-01-27T20:03:46.3531953Z Task : Bash 2026-01-27T20:03:46.3532054Z Description : Run a Bash script on macOS, Linux, or Windows 2026-01-27T20:03:46.3532186Z Version : 3.259.0 2026-01-27T20:03:46.3532295Z Author : Microsoft Corporation 2026-01-27T20:03:46.3532410Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash 2026-01-27T20:03:46.3532558Z ============================================================================== 2026-01-27T20:03:46.5980283Z Generating script. 2026-01-27T20:03:46.5992105Z ========================== Starting Command Output =========================== 2026-01-27T20:03:46.6000280Z [command]/usr/bin/bash /home/vsts/work/_temp/46883133-f9d6-4cb8-9424-84b62270df7d.sh 2026-01-27T20:03:47.1910981Z  2026-01-27T20:03:47.1912107Z Installing opencode version: 1.1.36 2026-01-27T20:03:47.5704686Z #=#=# 2026-01-27T20:03:47.6741685Z ##O#-# 2026-01-27T20:03:47.6743029Z 2026-01-27T20:03:47.7757716Z ##################################### 52.3% 2026-01-27T20:03:47.8750552Z ############################################################ 83.9% 2026-01-27T20:03:47.9531172Z ############################################################## 86.3% 2026-01-27T20:03:47.9532683Z ######################################################################## 100.0% 2026-01-27T20:03:49.2086828Z Successfully added opencode to $PATH in /home/vsts/.bashrc 2026-01-27T20:03:49.2088256Z 2026-01-27T20:03:49.2089658Z   ▄ 2026-01-27T20:03:49.2100277Z █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█ 2026-01-27T20:03:49.2102162Z █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀ 2026-01-27T20:03:49.2103757Z ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ 2026-01-27T20:03:49.2104598Z 2026-01-27T20:03:49.2105155Z 2026-01-27T20:03:49.2106380Z OpenCode includes free models, to start: 2026-01-27T20:03:49.2106790Z 2026-01-27T20:03:49.2107602Z cd <project> # Open directory 2026-01-27T20:03:49.2108481Z opencode # Run command 2026-01-27T20:03:49.2108818Z 2026-01-27T20:03:49.2109710Z For more information visit https://opencode.ai/docs 2026-01-27T20:03:49.2110139Z 2026-01-27T20:03:49.2110469Z 2026-01-27T20:03:49.7985938Z INFO 2026-01-27T20:03:49 +124ms service=models.dev file={} refreshing 2026-01-27T20:03:50.0606040Z 1.1.36 2026-01-27T20:03:50.0787579Z 2026-01-27T20:03:50.0857711Z ##[section]Finishing: Install OpenCode 2026-01-27T20:14:25.4946801Z ##[section]Starting: Generate PR Review 2026-01-27T20:14:25.4953921Z ============================================================================== 2026-01-27T20:14:25.4954051Z Task : Bash 2026-01-27T20:14:25.4954124Z Description : Run a Bash script on macOS, Linux, or Windows 2026-01-27T20:14:25.4954217Z Version : 3.259.0 2026-01-27T20:14:25.4954294Z Author : Microsoft Corporation 2026-01-27T20:14:25.4954374Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash 2026-01-27T20:14:25.4954478Z ============================================================================== 2026-01-27T20:14:25.8327001Z Generating script. 2026-01-27T20:14:25.8360113Z Script contents: 2026-01-27T20:14:25.8360806Z opencode run -m "$OPENCODE_MODEL" "Say hello" 2026-01-27T20:14:25.8361659Z ========================== Starting Command Output =========================== 2026-01-27T20:14:25.8362703Z [command]/usr/bin/bash /home/vsts/work/_temp/de9a09a9-d74a-4552-a743-4dabca2bfc76.sh 2026-01-27T20:14:26.4440769Z INFO 2026-01-27T20:14:26 +121ms service=models.dev file={} refreshing ` how can i debug it? It runs perfectly fine on my machine in bash
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2026):

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

  • #3885: Run OpenCode inside a Azure DevOps Pipeline - Also describes OpenCode getting stuck in Azure DevOps with no output
  • #9954: OpenCode GitHub Action hangs indefinitely at "Sending message to opencode…" (no output) - Similar hanging behavior in CI/CD with Azure provider
  • #8203: opencode run hangs forever on API errors (breaks CLI/automation integrations) - Describes hanging behavior in CLI/automation contexts
  • #5888: Opencode Hangs when used as CLI tool - General hanging issue when running opencode in CI/CD environments
  • #4506: bug: opencode run hangs when encountering certain errors instead of exiting (CLOSED) - Previously reported Azure DevOps Pipeline issue with hanging behavior

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

@github-actions[bot] commented on GitHub (Jan 27, 2026): This issue might be a duplicate of existing issues. Please check: - #3885: Run OpenCode inside a Azure DevOps Pipeline - Also describes OpenCode getting stuck in Azure DevOps with no output - #9954: OpenCode GitHub Action hangs indefinitely at "Sending message to opencode…" (no output) - Similar hanging behavior in CI/CD with Azure provider - #8203: opencode run hangs forever on API errors (breaks CLI/automation integrations) - Describes hanging behavior in CLI/automation contexts - #5888: Opencode Hangs when used as CLI tool - General hanging issue when running opencode in CI/CD environments - #4506: bug: opencode run hangs when encountering certain errors instead of exiting (CLOSED) - Previously reported Azure DevOps Pipeline issue with hanging behavior Feel free to ignore if none of these address your specific case.
Author
Owner

@sschuetz2bit commented on GitHub (Jan 29, 2026):

i was able to get it running by using:
script -q -c 'opencode run -m $OPENCODE_MODEL "say hello"' /dev/null

@sschuetz2bit commented on GitHub (Jan 29, 2026): i was able to get it running by using: script -q -c 'opencode run -m $OPENCODE_MODEL "say hello"' /dev/null
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7774