fix(ci): CUA smoke true-E2E with local opencode server (#15) (#18)

* chore: repoint OpenCode links to agentlabs.cc/opencode

agentlabs.cc/opencode and /opencode/privacy are now live (200). Repoint
README, distribution listings (Play/App Store/F-Droid/IzzyOnDroid/iOS),
docs, and in-app privacy links (settings + telemetry consent) from
www.vibebrowser.app/opencode to the canonical agentlabs.cc hub.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(ci): run local opencode server for CUA smoke true-E2E (#15)

GitHub-hosted runners can't reach the Tailscale dev server
(100.108.64.76:4096), so the CUA smoke always failed at session creation.

- Install opencode-ai and run `opencode serve` on the runner host; the
  Android emulator reaches it via 10.0.2.2. OPENCODE_URL now points there.
- Healthcheck /global/health before launching the app; dump server log on
  failure for diagnosis.
- Add --only-connect-scenario to the smoke script and run just the
  connect-and-verify-sessions path in CI: deterministic, needs no model
  backend. The scenario now creates a session if the list is empty, so a
  fresh server still yields a non-empty list.

This makes the smoke a true E2E and also exercises the #10 sessions-list
rendering path against a real server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(ci): emulator smoke script is dash, not bash — drop brace-group healthcheck

android-emulator-runner runs the script: block under /usr/bin/sh (dash). The
multi-line `|| { ...; }` healthcheck was a dash syntax error (end of file
unexpected), failing the step before the smoke ran. Replace with a non-fatal
one-line re-check; the server was already health-gated in the prior step.

* docs(tasks): record smoke CI round 1 failure + dash fix

---------

Co-authored-by: engineer <engineer@opencode.ai>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Den
2026-06-01 15:32:06 -07:00
committed by GitHub
parent d1888dc392
commit c9a57901c4
13 changed files with 95 additions and 24 deletions

View File

@@ -19,7 +19,9 @@ jobs:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_API_VERSION: "2024-08-01-preview"
OPENCODE_URL: "http://100.108.64.76:4096"
# Android emulator reaches the runner host loopback via 10.0.2.2.
# A real `opencode serve` runs on the host (see steps below), making this a true E2E.
OPENCODE_URL: "http://10.0.2.2:4096"
ARCHIVEBOX_URL: ${{ secrets.ARCHIVEBOX_URL }}
ARCHIVEBOX_API_KEY: ${{ secrets.ARCHIVEBOX_API_KEY }}
steps:
@@ -67,6 +69,22 @@ jobs:
- name: Install Python deps
run: pip install openai
- name: Install & start opencode server on runner host
run: |
npm install -g opencode-ai
# Bind all interfaces so the emulator can reach it via 10.0.2.2.
nohup opencode serve --hostname 0.0.0.0 --port 4096 > /tmp/opencode-server.log 2>&1 &
echo "Waiting for opencode server /global/health ..."
for i in $(seq 1 60); do
if curl -sf http://127.0.0.1:4096/global/health > /dev/null; then
echo "opencode server healthy after ${i}s"; break
fi
sleep 1
done
curl -sf http://127.0.0.1:4096/global/health || {
echo "::error::opencode server failed to become healthy"; cat /tmp/opencode-server.log; exit 1;
}
- name: Run CUA smoke test with emulator
uses: reactivecircus/android-emulator-runner@v2
with:
@@ -74,11 +92,20 @@ jobs:
arch: x86_64
target: google_apis
emulator-options: -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -no-snapshot
# NOTE: android-emulator-runner runs this script with /usr/bin/sh (dash).
# Avoid bash-only constructs like multi-line `|| { ... }` brace groups.
script: |
# Non-fatal re-check; server health was already gated in the prior step.
curl -sf http://127.0.0.1:4096/global/health || echo "WARN: opencode health re-check failed (started in prior step)"
adb install android/app/build/outputs/apk/release/app-release.apk
adb shell am start -n cc.agentlabs.opencode/.MainActivity
sleep 5
python3 scripts/android-cua-smoke.py --model gpt-5.4 --include-xml
# True E2E: app connects to the local opencode server (10.0.2.2:4096) and verifies the session list.
python3 scripts/android-cua-smoke.py --model gpt-5.4 --include-xml --only-connect-scenario
- name: opencode server log
if: always()
run: cat /tmp/opencode-server.log || true
- name: Upload test artifacts
if: always()