feat(daemon): streaming SSE reverse-proxy for agent routes (#2150) (#… #1195
Workflow file for this run
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 | ||
| # Main GAIA CLI testing workflow that coordinates platform-specific tests | ||
| # This workflow calls both Windows (full integration) and Linux (Lemonade-independent) tests | ||
| # Platform Coverage: Windows (full) + Linux (partial) + cross-platform validation | ||
| name: GAIA CLI Tests (All Platforms) | ||
| on: | ||
| # Only run via workflow_call or manual dispatch | ||
| # Individual child workflows (test_unit.yml, test_code_agent.yml, etc.) trigger | ||
| # on push/pull_request independently - this avoids duplicate/conflicting runs | ||
| workflow_call: | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: read | ||
| # Group concurrent runs but don't cancel - child workflows have their own concurrency | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: false | ||
| jobs: | ||
| # Run linting first (fast feedback) | ||
| lint: | ||
| name: Code Quality (Linting) | ||
| uses: ./.github/workflows/lint.yml | ||
| # Run unit tests second (fast, no external dependencies) | ||
| unit-tests: | ||
| name: Unit Tests (Fast) | ||
| needs: lint | ||
| uses: ./.github/workflows/test_unit.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Note: Lemonade Server Smoke Test runs as standalone workflow (test_lemonade_server.yml) | ||
| # It's not called here to avoid duplicate runs on self-hosted [stx] runner | ||
| # Test Windows CLI with full Lemonade integration | ||
| test-windows: | ||
| name: Windows CLI Tests (Full Integration) | ||
| needs: lint | ||
| uses: ./.github/workflows/test_gaia_cli_windows.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Linux CLI with full Lemonade integration | ||
| test-linux: | ||
| name: Linux CLI Tests (Full Integration) | ||
| needs: lint | ||
| uses: ./.github/workflows/test_gaia_cli_linux.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test MCP Bridge functionality | ||
| test-mcp: | ||
| name: MCP Bridge Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_mcp.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Code Agent functionality | ||
| test-code-agent: | ||
| name: Code Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_code_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Chat Agent functionality | ||
| test-chat-agent: | ||
| name: Chat Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_chat_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Connectors Demo Agent (standalone hub wheel, #1102) | ||
| test-connectors-demo: | ||
| name: Connectors Demo Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_connectors_demo.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Analyst Agent (standalone hub wheel, #1102) | ||
| test-analyst-agent: | ||
| name: Analyst Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_analyst_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Browser Agent (standalone hub wheel, #1102) | ||
| test-browser-agent: | ||
| name: Browser Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_browser_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test DocQA Agent (standalone hub wheel, #1102) | ||
| test-docqa-agent: | ||
| name: DocQA Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_docqa_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Routing Agent (standalone hub wheel, #1102) | ||
| test-routing-agent: | ||
| name: Routing Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_routing_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Email Agent (standalone hub wheel, #1102) | ||
| test-email-agent: | ||
| name: Email Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_email_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test DocQA Agent (standalone hub wheel, #1102) | ||
| test-docqa-agent: | ||
| name: DocQA Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_docqa_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Routing Agent (standalone hub wheel, #1102) | ||
| test-routing-agent: | ||
| name: Routing Agent Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_routing_agent.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Test Security features | ||
| test-security: | ||
| name: Security Tests | ||
| needs: lint | ||
| uses: ./.github/workflows/test_security.yml | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci') | ||
| # Summary job that reports overall status | ||
| test-summary: | ||
| name: Test Summary | ||
| runs-on: ubuntu-latest | ||
| needs: [lint, unit-tests, test-windows, test-linux, test-mcp, test-code-agent, test-chat-agent, test-connectors-demo, test-analyst-agent, test-browser-agent, test-docqa-agent, test-routing-agent, test-email-agent, test-security] | ||
| # Run always except when workflow or any dependency is cancelled (e.g., by cancel-in-progress) | ||
| if: >- | ||
| ${{ always() && !cancelled() && | ||
| needs.lint.result != 'cancelled' && | ||
| needs.unit-tests.result != 'cancelled' && | ||
| needs.test-windows.result != 'cancelled' && | ||
| needs.test-linux.result != 'cancelled' && | ||
| needs.test-mcp.result != 'cancelled' && | ||
| needs.test-code-agent.result != 'cancelled' && | ||
| needs.test-chat-agent.result != 'cancelled' && | ||
| needs.test-security.result != 'cancelled' }} | ||
| steps: | ||
| - name: Check test results | ||
| run: | | ||
| echo "=== GAIA CLI Test Summary ===" | ||
| echo "Lint Status: ${{ needs.lint.result }}" | ||
| echo "Unit Tests Status: ${{ needs.unit-tests.result }}" | ||
| echo "Windows Tests Status: ${{ needs.test-windows.result }}" | ||
| echo "Linux Tests Status: ${{ needs.test-linux.result }}" | ||
| echo "MCP Tests Status: ${{ needs.test-mcp.result }}" | ||
| echo "Code Agent Tests Status: ${{ needs.test-code-agent.result }}" | ||
| echo "Chat Agent Tests Status: ${{ needs.test-chat-agent.result }}" | ||
| echo "Security Tests Status: ${{ needs.test-security.result }}" | ||
| echo "" | ||
| # Check if all tests were skipped (draft PR without ready_for_ci label) | ||
| if [[ "${{ needs.lint.result }}" == "skipped" && | ||
| "${{ needs.unit-tests.result }}" == "skipped" && | ||
| "${{ needs.test-windows.result }}" == "skipped" && | ||
| "${{ needs.test-linux.result }}" == "skipped" && | ||
| "${{ needs.test-mcp.result }}" == "skipped" && | ||
| "${{ needs.test-code-agent.result }}" == "skipped" && | ||
| "${{ needs.test-chat-agent.result }}" == "skipped" && | ||
| "${{ needs.test-security.result }}" == "skipped" ]]; then | ||
| echo "⏭️ All tests skipped (draft PR - add 'ready_for_ci' label to run)" | ||
| exit 0 | ||
| fi | ||
| # Check if all integration tests were skipped/cancelled (workflow cancelled early) | ||
| if [[ "${{ needs.unit-tests.result }}" == "skipped" && | ||
| "${{ needs.test-windows.result }}" == "skipped" && | ||
| "${{ needs.test-linux.result }}" == "skipped" && | ||
| "${{ needs.test-mcp.result }}" == "skipped" && | ||
| "${{ needs.test-code-agent.result }}" == "skipped" && | ||
| "${{ needs.test-chat-agent.result }}" == "skipped" && | ||
| "${{ needs.test-security.result }}" == "skipped" ]]; then | ||
| echo "⏭️ Workflow cancelled or lint failed - no integration tests ran" | ||
| exit 0 | ||
| fi | ||
| # Helper function to check if result is acceptable (success or skipped) | ||
| check_result() { | ||
| [[ "$1" == "success" || "$1" == "skipped" ]] | ||
| } | ||
| # Determine overall status (success or skipped are both acceptable) | ||
| if check_result "${{ needs.lint.result }}" && | ||
| check_result "${{ needs.unit-tests.result }}" && | ||
| check_result "${{ needs.test-windows.result }}" && | ||
| check_result "${{ needs.test-linux.result }}" && | ||
| check_result "${{ needs.test-mcp.result }}" && | ||
| check_result "${{ needs.test-code-agent.result }}" && | ||
| check_result "${{ needs.test-chat-agent.result }}" && | ||
| check_result "${{ needs.test-security.result }}"; then | ||
| echo "✅ All tests passed!" | ||
| echo "- Unit Tests: Fast SDK component tests (DatabaseMixin, LLM, ASR, TTS)" | ||
| echo "- Windows: Full CLI functionality with Lemonade integration" | ||
| echo "- Linux: Full CLI functionality with Lemonade integration" | ||
| echo "- MCP: HTTP-native bridge and protocol compliance" | ||
| echo "- Code Agent: Autonomous code generation and modification" | ||
| echo "- Chat Agent: Session persistence and chat history" | ||
| echo "- Security: Path validation and shell injection prevention" | ||
| echo "- Cross-platform: Code quality and compatibility" | ||
| else | ||
| echo "❌ Some tests failed:" | ||
| [[ "${{ needs.lint.result }}" == "failure" ]] && echo " - Linting failed" | ||
| [[ "${{ needs.unit-tests.result }}" == "failure" ]] && echo " - Unit tests failed" | ||
| [[ "${{ needs.test-windows.result }}" == "failure" ]] && echo " - Windows tests failed" | ||
| [[ "${{ needs.test-linux.result }}" == "failure" ]] && echo " - Linux tests failed" | ||
| [[ "${{ needs.test-mcp.result }}" == "failure" ]] && echo " - MCP tests failed" | ||
| [[ "${{ needs.test-code-agent.result }}" == "failure" ]] && echo " - Code Agent tests failed" | ||
| [[ "${{ needs.test-chat-agent.result }}" == "failure" ]] && echo " - Chat Agent tests failed" | ||
| [[ "${{ needs.test-security.result }}" == "failure" ]] && echo " - Security tests failed" | ||
| exit 1 | ||
| fi | ||
| - name: Report test coverage | ||
| run: | | ||
| echo "" | ||
| echo "=== Test Coverage by Platform ===" | ||
| echo "🔌 Lemonade Server (Smoke Test):" | ||
| echo " ✅ Health endpoint verification" | ||
| echo " ✅ Models endpoint verification" | ||
| echo " ✅ Basic inference test" | ||
| echo "" | ||
| echo "⚡ Unit Tests (Fast, No Dependencies):" | ||
| echo " ✅ DatabaseMixin: SQLite database access for agents" | ||
| echo " ✅ LLM Client: Language model client utilities" | ||
| echo " ✅ ASR: Automatic speech recognition utilities" | ||
| echo " ✅ TTS: Text-to-speech utilities" | ||
| echo "" | ||
| echo "🪟 Windows (Full Integration):" | ||
| echo " ✅ CLI installation and setup" | ||
| echo " ✅ Lemonade server integration" | ||
| echo " ✅ Core commands (chat, prompt, llm)" | ||
| echo " ✅ Audio features (talk command)" | ||
| echo " ✅ Evaluation tools" | ||
| echo " ✅ Summarizer CLI integration" | ||
| echo " ✅ Process management" | ||
| echo "" | ||
| echo "🐧 Linux (Full Integration):" | ||
| echo " ✅ CLI installation and setup" | ||
| echo " ✅ Lemonade server with Gemma model" | ||
| echo " ✅ Core commands (chat, prompt, llm)" | ||
| echo " ✅ Evaluation tools (eval, groundtruth, report)" | ||
| echo " ✅ Summarizer CLI integration" | ||
| echo " ✅ Cross-platform process management" | ||
| echo " ✅ Python import compatibility" | ||
| echo "" | ||
| echo "🌐 MCP Bridge (Cross-Platform):" | ||
| echo " ✅ HTTP-native bridge server" | ||
| echo " ✅ JSON-RPC protocol compliance" | ||
| echo " ✅ LLM agent integration" | ||
| echo " ✅ Tool registration and discovery" | ||
| echo " ✅ Error handling and recovery" | ||
| echo " ✅ CORS support for browser clients" | ||
| echo " ⏭️ Jira integration (skipped - requires auth)" | ||
| echo "" | ||
| echo "🔒 Security Tests (Cross-Platform):" | ||
| echo " ✅ Path traversal prevention (PathValidator)" | ||
| echo " ✅ Shell command injection prevention" | ||
| echo " ✅ Agent security boundary enforcement" | ||
| echo " ✅ Argument sanitization" | ||
| echo " ✅ Access control validation" | ||
| echo " ✅ Windows and Linux security verification" | ||
| echo "" | ||
| echo "🎉 Full Platform Support Achieved!" | ||
| echo " 🔧 Future enhancements:" | ||
| echo " 🚧 Audio/TTS functionality testing" | ||
| echo " 🚧 NPU driver support (if available)" | ||
| echo " 🚧 Performance optimization" | ||