Skip to content

fix(ci): bump opencode Azure apiVersion to support /responses endpoint (#22)#24

Merged
dzianisv merged 5 commits into
mainfrom
fix/cua-azure-api-version-22
Jun 14, 2026
Merged

fix(ci): bump opencode Azure apiVersion to support /responses endpoint (#22)#24
dzianisv merged 5 commits into
mainfrom
fix/cua-azure-api-version-22

Conversation

@dzianisv

@dzianisv dzianisv commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Why

cua-smoke probe returns MODEL_CAPABLE=false (run 27148871066) because opencode's @ai-sdk/azure provider was hitting /openai/v1/responses with the old apiVersion=2024-08-01-preview and getting back:

{"error":{"code":"BadRequest","message":"API version not supported"}}

That collapsed the smoke to connect_and_verify_sessions,verify_session_list and skipped send_message/multi_turn — the actual reply path the issue asked us to cover.

What

Split into two envs:

  • AZURE_OPENAI_API_VERSION=2024-08-01-preview — keeps the CUA driver pinned (chat-completions endpoint, proven working).
  • OPENCODE_AZURE_API_VERSION=2025-04-01-preview — used in opencode.json provider config, supports the new /responses API.

Verification

On merge, the CUA smoke probe should return HTTP 200 with an assistant pong reply → MODEL_CAPABLE=true → scenarios become connect_and_verify_sessions,send_message,verify_session_list. Watch the Probe opencode model capability step in the next run.

Closes #22.

dzianisv and others added 3 commits June 9, 2026 08:53
#22)

The CUA smoke probe was returning MODEL_CAPABLE=false because opencode's
@ai-sdk/azure provider got 'API version not supported' from Azure on
/openai/v1/responses with apiVersion=2024-08-01-preview. Split into two
envs: keep the CUA driver on 2024-08-01-preview (chat-completions only)
and bump the opencode-side provider config to 2025-04-01-preview, which
supports the new responses API.

Effect: send_message/multi_turn scenarios get included again in CUA smoke
when the probe succeeds.
Step 11 'Start opencode server' has hung past the 45-min job timeout in
two consecutive runs (27195348071, 27198238465). Local boot of
opencode-ai 1.16.2 with the same heredoc config is healthy in 3s, so
something is wrong specifically on the GH-hosted runner — likely curl
post-loop waiting indefinitely on an unresponsive server.

Adds:
- set -x for command tracing
- --connect-timeout 2 -m 5 on every curl so hangs cannot exceed 5s
- HEALTHY flag + explicit exit 1 (drops the unbounded post-loop curl)
- Periodic dump every 10s: server log tail, ss listening sockets,
  process liveness — so we can see WHY the server isn't replying

Pure diagnostics; no behaviour change for the green path.
Reproduced the probe failure locally against the same Azure resource:
all date-based api-versions (2024-08-01-preview, 2024-12-01-preview,
2025-01-01-preview, 2025-03-01-preview, 2025-04-01-preview) return:

    {"error":{"code":"BadRequest","message":"API version not supported"}}

Only api-version=preview and api-version=v1 succeed (200). This is the
new Azure OpenAI v1 responses-API style; date strings are reserved for
the legacy /openai/deployments/{model}/chat/completions endpoint.

@ai-sdk/azure 3.x already defaults apiVersion to "preview" (per the
type definition: "Custom api version to use. Defaults to `preview`."),
so this aligns the workflow with the SDK default. Probe should now
return MODEL_CAPABLE=true and the send_message scenario will run.
@dzianisv

dzianisv commented Jun 9, 2026

Copy link
Copy Markdown
Owner Author

Reproduced root cause locally — it was not the api-version date being too old. The Azure resource's /openai/v1/responses endpoint accepts only api-version=preview or v1. Every date-based value (2024-08-01-preview, 2024-12-01-preview, 2025-01-01-preview, 2025-03-01-preview, 2025-04-01-preview) returns:

HTTP 400 {"error":{"code":"BadRequest","message":"API version not supported"}}

Only v1 and preview return 200. @ai-sdk/azure 3.x type def confirms: Custom api version to use. Defaults to preview. So preview aligns with the SDK default.

Pushed 094c076. Re-dispatching CUA-smoke.

dzianisv added 2 commits June 9, 2026 11:28
Assistant bubbles can take 15+ seconds to appear after send. Previous
5-second wait was too short and caused false failures even when API
calls succeeded. Re-check screenshots periodically up to 30s total.
The send action's auto-locate filtered for y1 > 2200 and fell back to
hardcoded (996, 2358) — both assume a 1080x2400 panel. The CI emulator
(API 30 google_apis pixel profile) is 1080x1920, so:
  - the bottom_buttons filter never matched any clickable element
  - the fallback tap landed off-screen
  → 'ping' message never sent, scenario timed out with no bubbles.

Switch to a screen-relative threshold (bottom 25%) and a fallback that
uses get_screen_size() to land in the bottom-right corner regardless of
device resolution. This was masked until now because send_message was
gated by MODEL_CAPABLE=false in earlier CI runs.

Refs: #22
@dzianisv dzianisv merged commit 71a1feb into main Jun 14, 2026
4 checks passed
@dzianisv dzianisv deleted the fix/cua-azure-api-version-22 branch June 14, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: wire a free provider so cua-smoke runs send_message/reply scenarios on-device

1 participant