diff --git a/.github/scripts/resolve-dario-proxy.sh b/.github/scripts/resolve-dario-proxy.sh new file mode 100755 index 0000000..3dcab03 --- /dev/null +++ b/.github/scripts/resolve-dario-proxy.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Discover the host-local Dario proxy (Claude Max OAuth) for self-hosted runners. +set -euo pipefail + +GW="" +if command -v ip >/dev/null 2>&1; then + GW="$(ip route 2>/dev/null | awk '/default/{print $3; exit}')" +fi +for H in host.containers.internal "$GW" 172.18.0.1 172.17.0.1 127.0.0.1; do + [ -z "$H" ] && continue + if curl -fsS --max-time 8 \ + -X POST "http://$H:3456/v1/chat/completions" \ + -H 'content-type: application/json' \ + -H 'authorization: Bearer dario' \ + -d '{"model":"claude-haiku-4-5","messages":[{"role":"user","content":"ok"}],"max_tokens":4,"stream":false}' \ + >/dev/null 2>&1; then + { + echo "base_url=http://$H:3456" + echo "api_key=dario" + } >> "${GITHUB_OUTPUT}" + echo "Dario proxy reachable at $H:3456" >&2 + exit 0 + fi +done + +echo "::error::Dario proxy (:3456) unreachable from the runner" >&2 +exit 1 \ No newline at end of file diff --git a/.github/scripts/resolve-hermes-proxy.sh b/.github/scripts/resolve-hermes-proxy.sh new file mode 100755 index 0000000..1d54760 --- /dev/null +++ b/.github/scripts/resolve-hermes-proxy.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Discover the host-local Hermes llm-proxy (Grok) for self-hosted runners. +set -euo pipefail + +GW="" +if command -v ip >/dev/null 2>&1; then + GW="$(ip route 2>/dev/null | awk '/default/{print $3; exit}')" +fi +for H in host.containers.internal "$GW" 172.18.0.1 172.17.0.1 127.0.0.1; do + [ -z "$H" ] && continue + if curl -fsS --max-time 6 "http://$H:38765/status" >/dev/null 2>&1; then + echo "url=http://$H:38765/api/v1/messages" >> "${GITHUB_OUTPUT}" + echo "Hermes proxy reachable at $H:38765" >&2 + exit 0 + fi +done + +echo "::error::Hermes proxy (:38765) unreachable from the runner" >&2 +exit 1 \ No newline at end of file diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index ebb9d12..1b0f265 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -13,16 +13,22 @@ jobs: review: name: Claude review if: vars.CLAUDE_REVIEW_ENABLED == 'true' && vars.CLAUDE_REVIEW_CONFIGURED == 'true' - runs-on: [self-hosted, linux, x64, spot-tech-ci] + runs-on: [self-hosted, logan-gl502vs] steps: - uses: actions/checkout@v5 with: fetch-depth: 0 + - name: Resolve Dario proxy + id: dario + run: bash .github/scripts/resolve-dario-proxy.sh + - uses: anthropics/claude-code-action@v1 + env: + ANTHROPIC_BASE_URL: ${{ steps.dario.outputs.base_url }} with: github_token: ${{ secrets.GITHUB_TOKEN }} - claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + anthropic_api_key: dario claude_args: "--max-turns 25" prompt: | Review this pull request for Agent Office and post concise inline review comments. Approve only if it is clean. Focus on, in priority order: diff --git a/.github/workflows/grok-review.yml b/.github/workflows/grok-review.yml index e4db652..1c9b526 100644 --- a/.github/workflows/grok-review.yml +++ b/.github/workflows/grok-review.yml @@ -16,7 +16,7 @@ jobs: review: name: Grok review (Hermes) if: vars.GROK_REVIEW_ENABLED == 'true' - runs-on: [self-hosted, linux, x64, spot-tech-ci] + runs-on: [self-hosted, logan-gl502vs] steps: - uses: actions/checkout@v5 with: @@ -24,18 +24,7 @@ jobs: - name: Resolve Hermes proxy id: proxy - run: | - GW="$(ip route 2>/dev/null | awk '/default/{print $3; exit}')" - for H in host.containers.internal "$GW" 172.18.0.1 172.17.0.1 127.0.0.1; do - [ -z "$H" ] && continue - if curl -fsS --max-time 6 "http://$H:38765/status" >/dev/null 2>&1; then - echo "url=http://$H:38765/api/v1/messages" >> "$GITHUB_OUTPUT" - echo "Hermes reachable at $H" - exit 0 - fi - done - echo "::error::Hermes proxy (:38765) unreachable from the runner" >&2 - exit 1 + run: bash .github/scripts/resolve-hermes-proxy.sh - name: Grok review env: