* fix(sessions): use active connection client directly, remove roots filter Root cause A: loadSessions was calling clientForDirectory(serverHome) which scoped the session list to /home/azureuser — a different project than the server's active CWD. Sessions in the current project (e.g. opencode-mobile) were never returned. Root cause B: roots:true filtered out sessions that have a parentID (sub-task / AUTO-REVIEW sessions), hiding valid sessions from the list. Fix: use connState.client directly (the connection's active directory) and drop the roots filter so all sessions for that project are visible. Also adds a verify_session_list CUA smoke scenario that navigates back to the sessions tab after creating a session and asserts the list is non-empty — covering the regression path that was previously untested. * fix(sessions): fetch serverHome in addConnection so loadSessions shows correct sessions Root cause: addConnection() built the HTTP client but never fetched serverHome (only loadConnections and setActiveConnection did). When the user adds a new connection (fresh install / first sign-in), serverHome = null, so loadSessions fell through to connState.client (the server's CWD). On this dev server the CWD is the deploy directory — 11 old May-19 sessions that are not the user's recent work sessions. Fix: addConnection now fetches currentProject + serverHome via the same Promise.all as setActiveConnection, before calling set(). This ensures loadSessions immediately uses clientForDirectory(serverHome) → the global project → the user's actual recent parent sessions. Also adds --opencode-url flag to the CUA smoke script, which appends a connect_and_verify_sessions scenario that reproduces the regression: python scripts/android-cua-smoke.py --opencode-url http://100.108.64.76:4096 * fix(sessions): recover home scope after fresh connect Resolve stale deploy-only session list by recovering server home during first load and keeping regression coverage in default Android CUA smoke and CI. * chore(release): bump version to 0.4.0
83 lines
2.6 KiB
YAML
83 lines
2.6 KiB
YAML
name: CUA Smoke Test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "scripts/android-cua-smoke.py"
|
|
- "src/**"
|
|
- "app/**"
|
|
- ".github/workflows/cua-smoke.yml"
|
|
|
|
jobs:
|
|
cua-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
|
|
- uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: 17
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v4
|
|
|
|
- name: Install Android system image & create AVD
|
|
run: |
|
|
sdkmanager "system-images;android-34;google_apis;x86_64" "emulator"
|
|
echo "no" | avdmanager create avd -n test -k "system-images;android-34;google_apis;x86_64" --force
|
|
|
|
- name: Start emulator
|
|
run: |
|
|
emulator -avd test -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -no-snapshot &
|
|
adb wait-for-device
|
|
timeout 120 bash -c 'while [ "$(adb shell getprop sys.boot_completed 2>/dev/null)" != "1" ]; do sleep 2; done'
|
|
|
|
- name: Install dependencies & build APK
|
|
run: |
|
|
npm install --legacy-peer-deps
|
|
npx expo prebuild --platform android --no-install
|
|
keytool -genkey -v -keystore android/app/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
|
|
cd android && ./gradlew assembleRelease
|
|
|
|
- name: Install APK on emulator
|
|
run: adb install android/app/build/outputs/apk/release/app-release.apk
|
|
|
|
- name: Launch app
|
|
run: |
|
|
adb shell am start -n ai.opencode.mobile/.MainActivity
|
|
sleep 5
|
|
|
|
- name: Install Python deps
|
|
run: pip install openai
|
|
|
|
- name: Run CUA smoke test
|
|
env:
|
|
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"
|
|
ARCHIVEBOX_URL: ${{ secrets.ARCHIVEBOX_URL }}
|
|
ARCHIVEBOX_API_KEY: ${{ secrets.ARCHIVEBOX_API_KEY }}
|
|
run: |
|
|
python3 scripts/android-cua-smoke.py \
|
|
--model gpt-5.4 \
|
|
--include-xml
|
|
|
|
- name: Upload test artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: cua-artifacts-${{ github.run_number }}
|
|
path: |
|
|
/tmp/cua_*.png
|
|
/tmp/cua_*.mp4
|
|
if-no-files-found: ignore
|