Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(ci): the paid-lane switch compares as a string: an unset GBRAIN_PAID_LANES is null, which GitHub's != coerced equal to '0' and skipped Tier 2 on every run (#5903)

garrytan4e8c34194700
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index b1f7918a3e..ac498804a3 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -553,8 +553,11 @@ jobs:
# Unset or any other value keeps them on. e2e-status accepts this job as
# `skipped` only when that exact variable is '0' and says so in the step
# summary; any other skip, failure or cancellation still fails the aggregate.
+ # format() keeps the comparison on strings: an unset variable is null, and
+ # GitHub's `!=` coerces null and '0' both to the number 0, which would skip
+ # this job on every repository that never set the variable.
needs: jsonb-parity
- if: vars.GBRAIN_PAID_LANES != '0'
+ if: format('{0}', vars.GBRAIN_PAID_LANES) != '0'
runs-on: ubicloud-standard-4-ubuntu-2404
timeout-minutes: 30
services:
diff --git a/.github/workflows/heavy-tests.yml b/.github/workflows/heavy-tests.yml
index c285481a54..1c3648df3b 100644
--- a/.github/workflows/heavy-tests.yml
+++ b/.github/workflows/heavy-tests.yml
@@ -831,7 +831,7 @@ jobs:
fail-fast: false
matrix:
# #5903: GBRAIN_PAID_LANES='0' switches the credentialed lane off even when it is requested.
- lane: ${{ fromJSON((inputs.run_opencode_paid || vars.GBRAIN_OPENCODE_PAID_E2E == '1') && vars.GBRAIN_PAID_LANES != '0' && '["keyless","credentialed"]' || '["keyless"]') }}
+ lane: ${{ fromJSON((inputs.run_opencode_paid || vars.GBRAIN_OPENCODE_PAID_E2E == '1') && format('{0}', vars.GBRAIN_PAID_LANES) != '0' && '["keyless","credentialed"]' || '["keyless"]') }}
# Measured local door wall-time: full 6-test run 35.8s + one-time
# compiled gbrain build (~2-4 min) + npm install (~15s); free-tier +
# paid turn budgets 2 x 240s each. 20 min = measured + >50% headroom.
diff --git a/test/paid-lanes-switch-5903.test.ts b/test/paid-lanes-switch-5903.test.ts
index 541095b2e4..9da7cf601a 100644
--- a/test/paid-lanes-switch-5903.test.ts
+++ b/test/paid-lanes-switch-5903.test.ts
@@ -62,7 +62,7 @@ function runAggregate(overrides: Partial<typeof GREEN>) {
describe('#5903 GBRAIN_PAID_LANES switches every paid lane off', () => {
test('tier2 is gated on the variable and e2e-status reads it from env', () => {
- expect(e2eJobs.tier2.if).toBe("vars.GBRAIN_PAID_LANES != '0'");
+ expect(e2eJobs.tier2.if).toBe("format('{0}', vars.GBRAIN_PAID_LANES) != '0'");
expect(aggregate!.env!.GBRAIN_PAID_LANES).toBe('${{ vars.GBRAIN_PAID_LANES }}');
expect(aggregate!.env!.TIER2).toBe('${{ needs.tier2.result }}');
expect(e2eJobs['e2e-status'].needs).toContain('tier2');
@@ -108,7 +108,7 @@ describe('#5903 GBRAIN_PAID_LANES switches every paid lane off', () => {
test('OpenCode credentialed lane stays keyless-only when the variable is 0', () => {
const lane = heavyJobs['opencode-door'].strategy?.matrix?.lane ?? '';
- expect(lane).toContain("vars.GBRAIN_PAID_LANES != '0' && '[\"keyless\",\"credentialed\"]'");
+ expect(lane).toContain("format('{0}', vars.GBRAIN_PAID_LANES) != '0' && '[\"keyless\",\"credentialed\"]'");
});
});
diff --git a/test/scripts/ci-gates.test.ts b/test/scripts/ci-gates.test.ts
index a353892040..9de4f47fd9 100644
--- a/test/scripts/ci-gates.test.ts
+++ b/test/scripts/ci-gates.test.ts
@@ -43,7 +43,7 @@ describe('CI execution evidence', () => {
}
expect(e2e.jobs.tier2.needs).toBe('jsonb-parity');
// No event gating: the only condition is the repository-wide paid-lane switch (#5903).
- expect(e2e.jobs.tier2.if).toBe("vars.GBRAIN_PAID_LANES != '0'");
+ expect(e2e.jobs.tier2.if).toBe("format('{0}', vars.GBRAIN_PAID_LANES) != '0'");
});
test('the verify job runs `bun run verify`, which dispatches through run-verify-parallel.sh', () => {
diff --git a/test/scripts/heavy-door-workflow.test.ts b/test/scripts/heavy-door-workflow.test.ts
index 01f6235d57..85501e1970 100644
--- a/test/scripts/heavy-door-workflow.test.ts
+++ b/test/scripts/heavy-door-workflow.test.ts
@@ -48,7 +48,7 @@ describe('heavy door supply chain and coverage gates', () => {
test('OpenCode defaults to keyless and explicitly requests a separate credentialed lane', () => {
expect(workflow.on.workflow_dispatch.inputs.run_opencode_paid.default).toBe(false);
// The credentialed lane is requested per dispatch or by GBRAIN_OPENCODE_PAID_E2E, and the repository-wide switch GBRAIN_PAID_LANES=0 keeps it off either way (#5903).
- expect(opencode.strategy?.matrix.lane).toBe('${{ fromJSON((inputs.run_opencode_paid || vars.GBRAIN_OPENCODE_PAID_E2E == \'1\') && vars.GBRAIN_PAID_LANES != \'0\' && \'["keyless","credentialed"]\' || \'["keyless"]\') }}');
+ expect(opencode.strategy?.matrix.lane).toBe('${{ fromJSON((inputs.run_opencode_paid || vars.GBRAIN_OPENCODE_PAID_E2E == \'1\') && format(\'{0}\', vars.GBRAIN_PAID_LANES) != \'0\' && \'["keyless","credentialed"]\' || \'["keyless"]\') }}');
expect(opencode.strategy?.['fail-fast']).toBe(false);
expect(opencode.env.ANTHROPIC_API_KEY).toBeUndefined();
const keyless = opencode.steps.find(step => step.name?.startsWith('Run opencode door tests (keyless'))!;