docs(copilot): add repository instructions bridge (#1853) #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved. | |
| # SPDX-License-Identifier: MIT | |
| # This workflow tests the Agent SDK functionality with Lemonade server integration | |
| # Tests include: Agent SDK API, conversation handling, and Lemonade integration | |
| # Platform: Windows (with Lemonade server support) | |
| name: Agent SDK Tests (Windows) | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - "setup.py" | |
| pull_request: | |
| branches: ["main"] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - "setup.py" | |
| merge_group: | |
| workflow_dispatch: | |
| # Cancel in-progress runs when a new run is triggered | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-agent-sdk-windows: | |
| name: Test Agent SDK on Windows (Lemonade Integration) | |
| runs-on: ${{ contains(github.event.pull_request.labels.*.name, 'stx-test') && 'stx-test' || 'stx' }} | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Python Environment | |
| uses: ./.github/actions/setup-venv | |
| with: | |
| python-version: '3.12' | |
| install-package: '.[dev]' | |
| - name: Install Lemonade Server | |
| uses: ./.github/actions/install-lemonade | |
| - name: Verify GAIA Installation | |
| run: | | |
| Write-Host "Verifying GAIA installation..." | |
| $gaiaPath = Get-Command gaia -ErrorAction SilentlyContinue | |
| if (-not $gaiaPath) { | |
| Write-Host "Error: gaia not installed correctly" | |
| Write-Host "Current PATH: $env:Path" | |
| exit 1 | |
| } | |
| Write-Host "Found gaia at: $($gaiaPath.Source)" | |
| python --version | |
| python -m pip check | |
| - name: Start Lemonade Server for Integration Tests | |
| timeout-minutes: 15 | |
| env: | |
| HUGGINGFACE_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }} | |
| HF_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }} | |
| run: | | |
| Write-Host "Verify Python environment" | |
| python -c "import sys; print(sys.executable)" | |
| Write-Host "Find gaia executable location" | |
| $gaiaPath = Get-Command gaia -ErrorAction SilentlyContinue | |
| if (-not $gaiaPath) { | |
| Write-Host "Error: Cannot find gaia executable in PATH" | |
| Write-Host "Current PATH: $env:Path" | |
| exit 1 | |
| } | |
| Write-Host "Found gaia at: $($gaiaPath.Source)" | |
| # Ensure a healthy, Gemma-warmed Lemonade server is up on 13305. The | |
| # helper launches the version-matched server as a persistent Scheduled | |
| # Task (survives across CI jobs since GitHub Actions kills job-spawned | |
| # processes), reuses it if already healthy, and warms Gemma-4. | |
| powershell -ExecutionPolicy Bypass -File installer\scripts\ensure-lemonade-running.ps1 -WarmModel "Gemma-4-E4B-it-GGUF" | |
| if ($LASTEXITCODE -ne 0) { throw "Lemonade server not ready" } | |
| - name: Run Agent SDK Integration Tests with Lemonade | |
| shell: cmd | |
| run: | | |
| REM Activate virtual environment | |
| call "%GITHUB_WORKSPACE%\.venv\Scripts\activate.bat" | |
| echo ================================================================ | |
| echo AGENT SDK INTEGRATION TESTS WITH LEMONADE SERVER | |
| echo ================================================================ | |
| echo Testing real LLM integration with running Lemonade server | |
| echo. | |
| echo **************************************************************** | |
| echo COMPREHENSIVE INTEGRATION TEST SUITE | |
| echo **************************************************************** | |
| echo Starting comprehensive integration tests at %TIME%... | |
| echo. | |
| REM Run the comprehensive integration test suite | |
| set PYTHONIOENCODING=utf-8 | |
| REM Use the model that was pulled above (matches DEFAULT_MODEL_NAME) | |
| set GAIA_TEST_MODEL=Gemma-4-E4B-it-GGUF | |
| python tests\test_agent_sdk.py | |
| set integration_exit=%ERRORLEVEL% | |
| echo. | |
| echo ---------------------------------------------------------------- | |
| echo Integration tests completed at %TIME% with exit code: %integration_exit% | |
| if %integration_exit% equ 0 ( | |
| echo [SUCCESS] Agent SDK integration tests passed | |
| ) else ( | |
| echo [FAILURE] Agent SDK integration tests failed with exit code %integration_exit% | |
| echo Full error output displayed above - no truncation | |
| ) | |
| echo ---------------------------------------------------------------- | |
| if %integration_exit% neq 0 ( | |
| exit /b 1 | |
| ) | |
| - name: Debug Agent SDK Logs on Failure | |
| if: failure() | |
| shell: cmd | |
| run: | | |
| echo === Debugging Agent SDK test failure === | |
| echo === Check for GAIA log files === | |
| if exist "gaia.cli.log" ( | |
| echo Found gaia.cli.log: | |
| type gaia.cli.log | |
| ) else ( | |
| echo No gaia.cli.log found | |
| ) | |
| echo === Check running processes === | |
| tasklist | findstr /i "python gaia lemonade-server" | |
| echo === Check ports in use === | |
| netstat -an | findstr ":8000 :8001" | |
| echo === Show recent Python errors === | |
| if exist "*.log" ( | |
| echo Recent log files: | |
| dir *.log | |
| ) | |
| echo === Environment information === | |
| echo VIRTUAL_ENV: %VIRTUAL_ENV% | |
| echo PATH: %PATH% |