Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/e2e-vitest-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,100 @@ jobs:
if-no-files-found: ignore
retention-days: 14

hermes-discord-vitest:
needs: generate-matrix
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',hermes-discord-vitest,') || contains(format(',{0},', inputs.scenarios), ',hermes-discord,') }}
runs-on: ubuntu-latest
timeout-minutes: 75
env:
FREE_STANDING_VITEST_JOB: "1"
FREE_STANDING_SCENARIO_ID: "hermes-discord"
E2E_ARTIFACT_DIR: ${{ github.workspace }}/e2e-artifacts/vitest/hermes-discord
NEMOCLAW_CLI_BIN: ${{ github.workspace }}/bin/nemoclaw.js
NEMOCLAW_RUN_E2E_SCENARIOS: "1"
NEMOCLAW_SANDBOX_NAME: e2e-hermes-discord
NEMOCLAW_AGENT: hermes
NEMOCLAW_POLICY_TIER: open
OPENSHELL_GATEWAY: nemoclaw
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Isolate Docker auth
run: echo "DOCKER_CONFIG=${RUNNER_TEMP}/docker-config-hermes-discord" >> "$GITHUB_ENV"

- name: Authenticate to Docker Hub
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
shell: bash
run: |
set -euo pipefail
if [[ -z "${DOCKERHUB_USERNAME}" || -z "${DOCKERHUB_TOKEN}" ]]; then
echo "::notice::Docker Hub credentials not configured; continuing with anonymous pulls."
exit 0
fi
login_succeeded=0
for attempt in 1 2 3; do
if echo "${DOCKERHUB_TOKEN}" | timeout 30s docker login docker.io --username "${DOCKERHUB_USERNAME}" --password-stdin; then
login_succeeded=1
break
fi
if [[ "$attempt" -lt 3 ]]; then
echo "::warning::Docker Hub login attempt ${attempt} failed; retrying."
sleep 5
fi
done
if [[ "$login_succeeded" -ne 1 ]]; then
echo "::warning::Docker Hub login failed after 3 attempts; continuing with anonymous pulls."
fi

- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0
with:
node-version: 22
cache: npm

- name: Install root dependencies
run: npm ci --ignore-scripts

- name: Build CLI
run: npm run build:cli

- name: Run Hermes Discord live test
# Migrated from test/e2e/test-hermes-discord-e2e.sh. Preserves the
# ubuntu-latest Docker/OpenShell/Hermes Discord schema, provider,
# placeholder isolation, native gateway rewrite, and rebuild contracts.
env:
NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }}
DISCORD_BOT_TOKEN: test-fake-discord-token-hermes-e2e
DISCORD_SERVER_IDS: "1491590992753590594"
DISCORD_ALLOWED_IDS: "1005536447329222676"
DISCORD_REQUIRE_MENTION: "0"
run: |
set -euo pipefail
npx vitest run --project e2e-scenarios-live \
test/e2e-scenario/live/hermes-discord.test.ts \
--silent=false --reporter=default

- name: Upload Hermes Discord artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-vitest-scenarios-hermes-discord
path: e2e-artifacts/vitest/hermes-discord/
include-hidden-files: false
if-no-files-found: ignore
retention-days: 14

- name: Clean up Docker auth
if: always()
run: |
set -euo pipefail
docker logout docker.io || true
rm -rf "${DOCKER_CONFIG}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard DOCKER_CONFIG expansion in cleanup path.

Line 1668 can fail under set -u when DOCKER_CONFIG is unset (for example, if earlier steps didn’t export $GITHUB_ENV). Use a defaulted expansion before rm -rf to keep always() cleanup robust.

Suggested fix
       - name: Clean up Docker auth
         if: always()
         run: |
           set -euo pipefail
           docker logout docker.io || true
-          rm -rf "${DOCKER_CONFIG}"
+          if [[ -n "${DOCKER_CONFIG:-}" ]]; then
+            rm -rf "${DOCKER_CONFIG}"
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Clean up Docker auth
if: always()
run: |
set -euo pipefail
docker logout docker.io || true
rm -rf "${DOCKER_CONFIG}"
- name: Clean up Docker auth
if: always()
run: |
set -euo pipefail
docker logout docker.io || true
if [[ -n "${DOCKER_CONFIG:-}" ]]; then
rm -rf "${DOCKER_CONFIG}"
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/e2e-vitest-scenarios.yaml around lines 1663 - 1668, The
"Clean up Docker auth" step uses `"${DOCKER_CONFIG}"` in the rm -rf command
which will fail under `set -u` if DOCKER_CONFIG is unset. Replace the variable
expansion with a defaulted expansion syntax `"${DOCKER_CONFIG:-}"` to ensure the
variable safely expands to an empty string if unset, preventing the script from
failing during cleanup.


network-policy-vitest:
needs: generate-matrix
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',network-policy-vitest,') || contains(format(',{0},', inputs.scenarios), ',network-policy,') }}
Expand Down Expand Up @@ -4901,6 +4995,7 @@ jobs:
sessions-agents-cli-vitest,
runtime-overrides-vitest,
hermes-e2e-vitest,
hermes-discord-vitest,
hermes-root-entrypoint-smoke-vitest,
network-policy-vitest,
common-egress-agent-vitest,
Expand Down
Loading
Loading