You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add scripts/gateway-ping-g23.mjs: one AI Gateway call through Factory's relay #183
A maintainer can check, from a worker's own shell, that the AI Gateway is reachable through Factory's relay: node scripts/gateway-ping-g23.mjs sends one prompt and prints the answer and its gateway-reported cost.
Acceptance
Use the ai devDependency already pinned at 7.0.165; package.json and package-lock.json do not change.
scripts/gateway-ping-g23.mjs (plain Node ES module) creates the gateway with createGateway({ apiKey: process.env.AI_GATEWAY_API_KEY, baseURL: \${process.env.FACTORY_GATEWAY_URL.replace(//$/, "")}/v4/ai` })fromai, calls generateTextwith modelnvidia/nemotron-3.5-lightning-freeand the promptSay ok., then prints two lines: text: <the answer's text>andcost: <providerMetadata.gateway.cost>`. It exits non-zero with one line on stderr when either variable is missing or the call fails (that line names the missing variable, or carries the error's message and HTTP status), and never prints the key.
You run node scripts/gateway-ping-g23.mjs exactly once from your own shell, and the PR body quotes its stdout verbatim (or, if it failed, its stderr and exit code).
npm run check and npm test pass; the only change is the new script.
Sources
package.json, AGENTS.md, scripts/gateway-ping-c5.mjs (an earlier script of the same shape)
The ai package's createGateway and generateText (version 7.0.165)
Context
A release gate run for Factory's metering gateway relay (Claude harness, Actions route). Recorded decisions: the model is the free nvidia/nemotron-3.5-lightning-free; AI_GATEWAY_API_KEY and FACTORY_GATEWAY_URL are given to your shell by Factory (the key is a relay token, not a real key); do not add ai-gateway.vercel.sh anywhere. The script is a manual check: no test calls it and CI never runs it. Make one call only. npm run test:db is Factory's validation to run; a database the setup started may be out of reach of your own commands.
Add a manual check script, scripts/gateway-ping-g23.mjs, that sends one prompt (Say ok.) to nvidia/nemotron-3.5-lightning-free through Factory's AI Gateway relay with the pinned ai@7.0.165, and prints the answer's text and the gateway-reported cost. Run it once and quote the output in the PR.
Checklist
Write scripts/gateway-ping-g23.mjs (owns: scripts/gateway-ping-g23.mjs). Covers acceptance entries 1 and 2 (no package.json/lockfile change; createGateway + generateText, two stdout lines, one stderr line with non-zero exit on a missing variable or failure, key never printed).
Run node scripts/gateway-ping-g23.mjs exactly once and record its stdout (or stderr and exit code) for the PR body. Covers acceptance entry 3.
Run npm run check and npm test; confirm the diff is just the new script. Covers acceptance entry 4.
Assumptions
The script follows the shape of scripts/gateway-ping-c5.mjs: the stderr line is prefixed gateway-ping-g23: , the key is masked as *** if it shows up in an error message, and the HTTP status is added as (HTTP <status>) when the error has one.
When the gateway reports no cost, the script prints cost: undefined rather than failing.
npm run check only covers src/ and test/, so I checked the script's syntax separately with node --check. The script is not added to check, because package.json must not change.
Design note
The repository has no design checklist. This is a standalone manual script: no test or CI job calls it.
Activity
clockgrove-factory commentedon Nov 13, 2026
Factory work run 43384608799 · PR #184: started 07:17Z, 3 min at the last line.
clockgrove-factory commentedon Nov 13, 2026
Goal
Add a manual check script,
scripts/gateway-ping-g23.mjs, that sends one prompt (Say ok.) tonvidia/nemotron-3.5-lightning-freethrough Factory's AI Gateway relay with the pinnedai@7.0.165, and prints the answer's text and the gateway-reported cost. Run it once and quote the output in the PR.Checklist
scripts/gateway-ping-g23.mjs(owns:scripts/gateway-ping-g23.mjs). Covers acceptance entries 1 and 2 (nopackage.json/lockfile change; createGateway + generateText, two stdout lines, one stderr line with non-zero exit on a missing variable or failure, key never printed).node scripts/gateway-ping-g23.mjsexactly once and record its stdout (or stderr and exit code) for the PR body. Covers acceptance entry 3.npm run checkandnpm test; confirm the diff is just the new script. Covers acceptance entry 4.Assumptions
scripts/gateway-ping-c5.mjs: the stderr line is prefixedgateway-ping-g23:, the key is masked as***if it shows up in an error message, and the HTTP status is added as(HTTP <status>)when the error has one.cost: undefinedrather than failing.npm run checkonly coverssrc/andtest/, so I checked the script's syntax separately withnode --check. The script is not added tocheck, becausepackage.jsonmust not change.Design note
The repository has no design checklist. This is a standalone manual script: no test or CI job calls it.
clockgrove-factory commentedon Nov 13, 2026
Factory review run 43385002779 · PR #184: started 07:20Z, 1 min at the last line.