Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(okx): fail the 3D services health lane when the settlement relayer has no gas
nirholas4e9ad0419a55
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9a90941c3..f716a0a01 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -50,6 +50,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **The economy solver says which level its numbers belong to, and shares a link that lands on them**: The solver at /play/solver reprices the whole /play world when you move the skill level, and it fetches the new level as you move. If that fetch failed, the page dimmed its tables slightly and said nothing else: the chart marker sat at level 60 while every table below it still held level 1 figures, with no visible explanation, no way to tell which level you were reading, and no retry. The explanation existed but was written only into a region screen readers can reach, so anyone looking at the page saw a silent mismatch. A failed level now raises a banner in the open that names the level that failed, says plainly that the figures below are still the old level, and offers both a retry and a way back. A level still loading shows the same banner as a busy state with the level it is solving, so a slow connection reads as slow rather than as broken. The page also writes the level into its own address bar now: it has always read a level from a shared link, but never wrote one, so sending someone the URL after dragging to level 60 sent them level 1. And a link asking for a level past the cap settles on the cap instead of leaving the page waiting on a level that will never arrive. Alongside it, a conclusion in the model that shouted one word in capitals now reads as a normal sentence. (`/play/solver`) `[fix, improvement]`- **The floorplan editor can make rooms, so a home with no areas is no longer a dead end**: Most Home Assistant setups we see have devices everywhere and not a single area, which left the 3D home and the floorplan with nothing to draw and the only advice we could give was to go and create areas in Home Assistant's own settings first. That is a chore people leave to do and do not come back from. The floorplan editor now makes the room itself: name it, and the area is created in your own Home Assistant, placed on the plan, and the device that prompted it is filed into it in the same step. It reaches your dashboards, your voice assistant and your automations too, because it is a real area in your registry and not a picture of one here. The tray tells a home with no rooms where to start, and a device you file no longer leaves a stale entry behind in the list. (`/smart-home`) `[feature, improvement]`- **The generated motion clips were playing upside down, and we can now tell**: Every one of the 133 motion clips three.ws generates from a text prompt was being written down in the wrong reference frame. The bone names all matched the rest of the library, so nothing looked wrong in the data, but a clip's rotations are measured against a rig's resting pose and the generator was measuring against a different one. The result was a half turn missing from the legs: play one of these clips on an avatar and the feet fold up over the body. Forward kinematics put the feet at 1.71 m and the head at 1.45 m, where a hand-authored clip puts them at 0.15 m and 1.68 m. Clips can now be converted into the library's own frame, which puts all 133 back on their feet, and the quality check has learned to spot the fault: it was invisible before because every other rule measures a clip against itself, and a clip in the wrong frame is perfectly consistent with itself. A second fault went with it. Every generated clip was drifting forward at about a quarter of a metre a second whatever it was asked for, so a clip of someone applauding walked a metre across the room while it clapped, and standing-still idles drifted faster than the walks did. That turned out to be an artifact of how the motion model's output is scaled back into real units, and it is now measured and removed while the real motion, a pirouette's sway or a walk's per-step surge, is kept. Removing it also repaired the foot-sliding check, which had been dividing by a stride that was never real, so the library's quality bar finally means something: 39 of the 133 clips meet it, and the rest are being held back rather than served. (`/animations`) `[fix, improvement]`+- **The health page for our paid 3D services now checks that a payment could actually be collected**: Every agent that buys a 3D generation from us on the OKX.AI marketplace can read a free health page first, and one of the lines on it says whether payment settlement is working. That line only ever checked that a settlement route was configured, not that it could run: the account that broadcasts a buyer's already-signed payment onto the chain pays the network fee for it, and if that account runs out of fee balance the page still read green while a paid call would have failed after the buyer had committed. The page now reports the fee balance it actually measured, and marks the payment lane down when nothing can settle, so the problem shows up on a free page before anyone pays rather than as a failure afterwards. (`/docs/okx-marketplace`) `[fix, improvement]`- **The homepage stops calling its Community strip live when no new models are arriving**: The Community strip on the homepage is headed "Made with Forge. Right now." and carries a pulsing live chip. That chip was switched on by the Fresh tab alone, so it asserted liveness no matter how old the newest model on the strip actually was. When our object storage started rejecting the platform's credential on 2026-09-07, finished generations could no longer be recorded, the strip froze on the last model stored before that, and the chip went on pulsing live over two-day-old work with nothing on the page to say otherwise. The chip is now earned by the data: it appears only when the newest model on the strip is from the last six hours, and it reads the newest timestamp in the list rather than trusting the order it arrives in. Older models still show exactly as before, because a quiet stretch is worth showing; it just is not live. (`/`) `[fix]`- **The in-game economy page reads correctly on a phone, and the boutique shows what you are buying**: A full audit of /play/economy, the published reference for every price, prize and gate in the /play world. On a 320px screen the general store and currency panels were wider than the viewport, and because the page suppresses sideways scrolling their right edge was simply cut off: the store's price column was unreachable on the narrowest phones. Those panels now shrink to fit, and the wide tables scroll inside their own labelled box instead. The bar showing how a paid $THREE sale splits used to print its labels inside the coloured segments, where "50% holder rewards" was truncated to "50% holder re..."; the split now reads from a legend beneath the bar, which stays legible at any ratio. In the boutique, the Stetson and the Shades rendered as blank grey circles while the five colour items showed their colour, because the page ignored the thumbnail the server was already sending; both now show the item, with the colour swatch as the fallback if an image ever goes missing. The wheel's top prize is relabelled "JACKPOT: 100 Cash", and a failed load now reads as a proper sentence before the retry hint. (`/play/economy`) `[fix, improvement]`- **The Money Pulse now tells you when its stats are down, and retries on the spot**: When the money-intelligence call behind /pulse failed, the three side panels (Top earners, Busiest wallets, Fresh launches) sat on "Loading..." forever and the 7-day activity strip went blank, which reads as "the platform is quiet" rather than "we could not fetch this". Each surface now says what went wrong, notes that the live feed itself is unaffected and that it retries every minute, and offers a Retry button that refetches immediately. First paint uses skeletons shaped like the real counters, bars and rows instead of dashes and a loading label, so nothing shifts when the numbers land. The empty states point somewhere useful now: no tips yet links to the agent directory, no wallet activity links to the agents that are online. Switching between mainnet and devnet shows the skeletons again rather than leaving the previous network's numbers under the new label. The stat cards report their filter state to screen readers, the rail cards are real headings, and the per-row explorer link is a full-size tap target that says where it goes. (`/pulse`) `[fix, improvement]`diff --git a/api/okx/3d/[service].js b/api/okx/3d/[service].jsindex 8af9cbaf2..ffe9bdea2 100644--- a/api/okx/3d/[service].js+++ b/api/okx/3d/[service].js@@ -188,11 +188,32 @@ async function healthReport() {// settlement-route configuration (OKX facilitator creds / relayer).const rail = await xlayerRailHealth();if (rail.rpc && !rail.rpc.ok) throw new Error(rail.rpc.error || 'X Layer RPC unreachable');+ // `rail.settleable` answers "is a settlement route configured", which+ // is not the same question a buyer is asking. When the OKX facilitator+ // is not credentialed the relayer redeems the authorization itself and+ // pays the gas, so a relayer with no OKB turns a collected payment into+ // a 502 at settle time. Report the gas reading rather than hiding it,+ // and fail the subsystem when no route can actually settle: a rail that+ // quotes a price it cannot collect is exactly the never-402-then-502+ // case the challenge gate exists to prevent.+ const facilitator = rail.facilitator?.configured ?? false;+ const relayerFunded = rail.relayer?.configured ? rail.relayer.funded === true : null;+ const settleable = rail.settleable && (facilitator || relayerFunded !== false);+ if (!settleable) {+ const err = new Error(+ facilitator || rail.relayer?.configured+ ? 'X Layer settlement relayer is out of gas (OKB balance 0)'+ : 'X Layer settlement route is not configured',+ );+ err.detail = { settleable: false, block: rail.rpc?.block, token: rail.token?.symbol, facilitator_configured: facilitator, relayer_funded: relayerFunded };+ throw err;+ }return {- settleable: rail.settleable,+ settleable,block: rail.rpc?.block,token: rail.token?.symbol,- facilitator_configured: rail.facilitator?.configured ?? false,+ facilitator_configured: facilitator,+ relayer_funded: relayerFunded,};}),]);diff --git a/data/changelog.json b/data/changelog.jsonindex c104ee534..38a746d18 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-09-09",+ "title": "The health page for our paid 3D services now checks that a payment could actually be collected",+ "summary": "Every agent that buys a 3D generation from us on the OKX.AI marketplace can read a free health page first, and one of the lines on it says whether payment settlement is working. That line only ever checked that a settlement route was configured, not that it could run: the account that broadcasts a buyer's already-signed payment onto the chain pays the network fee for it, and if that account runs out of fee balance the page still read green while a paid call would have failed after the buyer had committed. The page now reports the fee balance it actually measured, and marks the payment lane down when nothing can settle, so the problem shows up on a free page before anyone pays rather than as a failure afterwards.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/docs/okx-marketplace"+ },{"date": "2026-09-09","title": "The payments status page now says which of two opposite outages it is looking at",diff --git a/prompts/finish/_context/okx-ai-RUNBOOK.md b/prompts/finish/_context/okx-ai-RUNBOOK.mdindex e1b318c71..62542e34a 100644--- a/prompts/finish/_context/okx-ai-RUNBOOK.md+++ b/prompts/finish/_context/okx-ai-RUNBOOK.md@@ -188,11 +188,23 @@ Verified output (2026-09-09, the fields that matter):"status": 2, "statusLabel": "not listed", "soldCount": 2, "role": 2, "roleLabel": "ASP" }```-That is rejection #3's verdict, unchanged since 2026-09-05: the 4109-character `approvalRemark`-is byte-for-byte the one the 2026-09-04 session root-caused, and nothing has been resubmitted+That is rejection #3's verdict, unchanged since 2026-09-05: the `approvalRemark` is+byte-for-byte the one the 2026-09-04 session root-caused, and nothing has been resubmittedsince, so no new review has run. A rejection email arriving now is a re-send of that verdict,not a new one.+**Identify the remark by hash, not by length.** Its sha256 is+`c30676a2b95d7c84a9fb26e48b3ff07798664d9d3eb42873d956b1070c9fff0d` (re-read 2026-09-09), and+`get-my-agents` and `service-list` return the identical string. Earlier entries call it+"4109 characters" and a Python reader counts 4101: the remark carries CJK bracket and emoji+code points, so JavaScript's UTF-16 `.length` and Python's code-point `len()` disagree by 8 on+the same bytes. Neither number changing means the verdict changed. Compare the hash:++```bash+onchainos agent get-my-agents \+ | python3 -c "import json,sys,hashlib; a=[x for g in json.load(sys.stdin)['data']['list'] for x in g['agentList'] if x['agentId']=='2632'][0]; print(hashlib.sha256(a['approvalRemark'].encode()).hexdigest())"+```+### Reading the fields| Field | Meaning |@@ -331,7 +343,12 @@ The buyer needs **no OKB**: it signs an EIP-3009 authorization off-chain and thebroadcasts and pays gas, which is why the buyer's 0 OKB above is not a second blocker.Re-verify the relayer's OKB balance is still enough for ≥3 settlement tx before relying on-0.02 OKB, top up a few cents' worth if a dry run shows `broadcast_failed`/out-of-gas.+0.02 OKB, top up a few cents' worth if a dry run shows `broadcast_failed`/out-of-gas. Measured+2026-09-09: 0.020 OKB at a 0.021 gwei gas price, roughly 7,900 settlements, and its nonce is+still 0, so it has never broadcast one. `/api/okx/3d/health` reports that reading itself as+`relayer_funded` on the `payment-rail` row and fails the subsystem when the only settlement+route is a relayer with no gas, so a dry relayer shows up on the free health lane instead of+as a 502 after a buyer has already paid (committed 2026-09-09, live on the next deploy).Once funded, run [`okx-ai-04-e2e-real-payment-test.md`](../913-okx-ai-04-e2e-real-payment-test.md). It needs ≥3real settlements with transaction hashes.diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex ae2c71d01..c63d5227c 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-09-09T19:42:06.423Z",+ "generated_at": "2026-09-09T19:47:32.651Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 3653,+ "total": 3654,"complete": false,"full_feed": "/changelog.json","entries": [@@ -481,6 +481,17 @@"improvement"]},+ {+ "date": "2026-09-09",+ "type": "update",+ "title": "The health page for our paid 3D services now checks that a payment could actually be collected",+ "summary": "Every agent that buys a 3D generation from us on the OKX.AI marketplace can read a free health page first, and one of the lines on it says whether payment settlement is working. That line only ever checked that a settlement route was configured, not that it could run: the account that broadcasts a buyer's already-signed payment onto the chain pays the network fee for it, and if that account runs out of fee balance the page still read green while a paid call would have failed after the buyer had committed. The page now reports the fee balance it actually measured, and marks the payment lane down when nothing can settle, so the problem shows up on a free page before anyone pays rather than as a failure afterwards.",+ "link": "/docs/okx-marketplace",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-09-09","type": "update",@@ -1599,16 +1610,6 @@"feature","improvement"]- },- {- "date": "2026-09-05",- "type": "update",- "title": "IRL no longer fails to load your agent on a cold start",- "summary": "Opening IRL on a fresh page could show \"Couldn't load this agent\" with a Retry button even though nothing was wrong with your connection. The 3D loader was asked for a compressed avatar a moment before its decoder had finished arriving, and it gave up instead of waiting. Every avatar load on IRL and in the AR Studio now waits for that decoder, so the first load works the same as the retry always did.",- "link": "/irl",- "tags": [- "fix"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex c2bc0c86d..1a025e5db 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-09T19:42:06.399Z",+ "generated_at": "2026-09-09T19:47:32.630Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -478,6 +478,17 @@"improvement"]},+ {+ "date": "2026-09-09",+ "type": "update",+ "title": "The health page for our paid 3D services now checks that a payment could actually be collected",+ "summary": "Every agent that buys a 3D generation from us on the OKX.AI marketplace can read a free health page first, and one of the lines on it says whether payment settlement is working. That line only ever checked that a settlement route was configured, not that it could run: the account that broadcasts a buyer's already-signed payment onto the chain pays the network fee for it, and if that account runs out of fee balance the page still read green while a paid call would have failed after the buyer had committed. The page now reports the fee balance it actually measured, and marks the payment lane down when nothing can settle, so the problem shows up on a free page before anyone pays rather than as a failure afterwards.",+ "link": "/docs/okx-marketplace",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-09-09","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 72f8c4045..23d433135 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -358,6 +358,14 @@<category>fix</category><description>Every one of the 133 motion clips three.ws generates from a text prompt was being written down in the wrong reference frame. The bone names all matched the rest of the library, so nothing looked wrong in the data, but a clip's rotations are measured against a rig's resting pose and the generator was measuring against a different one. The result was a half turn missing from the legs: play one of these clips on an avatar and the feet fold up over the body. Forward kinematics put the feet at 1.71 m and the head at 1.45 m, where a hand-authored clip puts them at 0.15 m and 1.68 m. Clips can now be converted into the library's own frame, which puts all 133 back on their feet, and the quality check has learned to spot the fault: it was invisible before because every other rule measures a clip against itself, and a clip in the wrong frame is perfectly consistent with itself. A second fault went with it. Every generated clip was drifting forward at about a quarter of a metre a second whatever it was asked for, so a clip of someone applauding walked a metre across the room while it clapped, and standing-still idles drifted faster than the walks did. That turned out to be an artifact of how the motion model's output is scaled back into real units, and it is now measured and removed while the real motion, a pirouette's sway or a walk's per-step surge, is kept. Removing it also repaired the foot-sliding check, which had been dividing by a stride that was never real, so the library's quality bar finally means something: 39 of the 133 clips meet it, and the rest are being held back rather than served.</description></item>+ <item>+ <title>The health page for our paid 3D services now checks that a payment could actually be collected</title>+ <link>https://three.ws/docs/okx-marketplace</link>+ <guid isPermaLink="false">2026-09-09:The health page for our paid 3D services now checks that a payment could actually be collected</guid>+ <pubDate>Wed, 09 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Every agent that buys a 3D generation from us on the OKX.AI marketplace can read a free health page first, and one of the lines on it says whether payment settlement is working. That line only ever checked that a settlement route was configured, not that it could run: the account that broadcasts a buyer's already-signed payment onto the chain pays the network fee for it, and if that account runs out of fee balance the page still read green while a paid call would have failed after the buyer had committed. The page now reports the fee balance it actually measured, and marks the payment lane down when nothing can settle, so the problem shows up on a free page before anyone pays rather than as a failure afterwards.</description>+ </item><item><title>The homepage stops calling its Community strip live when no new models are arriving</title><link>https://three.ws/</link>diff --git a/public/features.json b/public/features.jsonindex e129cba4b..fa3df60e1 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-09T19:42:06.387Z",+ "generated_at": "2026-09-09T19:47:32.619Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/specs/okx-agent-payments.md b/specs/okx-agent-payments.mdindex 56df040ad..169fe6461 100644--- a/specs/okx-agent-payments.md+++ b/specs/okx-agent-payments.md@@ -14,7 +14,7 @@> **Post-implementation reconciliation (2026-07-07, WO-01 close-out session):** the contract below has since been **implemented** by WO-02/03 and **re-validated against still-live primary sources today**, the approved-seller 402 (oklink `get_chain_info`) is byte-identical to Appendix A, the OKX facilitator still returns `HTTP 401 code 50103` requiring `OK-ACCESS-KEY`, and USD₮0 is unchanged. Spec-vs-shipped conformance was checked: [`api/_lib/x402-xlayer-okx.js`](../api/_lib/x402-xlayer-okx.js) `okxXLayerAccept()` byte-matches §1.1 (scheme `exact`, `eip155:196`, USD₮0 asset, `extra{name:"USD₮0",version:"1",transferMethod:"eip3009",decimals:6}`, `maxTimeoutSeconds:86400`), reads `PAYMENT-SIGNATURE`, routes verify/settle through `OKXFacilitatorClient`, and emits `PAYMENT-RESPONSE` per §1.2. **The §4 gap list below is therefore historical, it was 02's work list and is now closed in code**, EXCEPT the runtime is still gated: the X Layer accept is only advertised when `xlayerSettleable()` is true (`X402_PAY_TO_XLAYER` + `X402_ASSET_ADDRESS_XLAYER` + OKX HMAC creds **or** `X402_XLAYER_RELAYER_KEY`). Those env vars were **not set in Vercel production** on the day this note was written, so `POST /api/okx/3d/*` then returned a **Solana-only** challenge with no `eip155:196` entry. **That runtime gate is CLOSED and has been since the Cloud Run migration.** Re-verified 2026-08-01 against live production: all 9 paid services return a spec-valid 402 whose `accepts[0]` is the `eip155:196` USD₮0 entry at exactly the catalog amount, and `/api/okx/3d/health` reports `payment-rail settleable: true`. The only thing still outstanding from this spec's perspective is funding the buyer wallet for a first settled payment; no code or research remains.-> **Note (2026-09-02, WO-07 audit): the last v1 string is gone.** The header *reading* has accepted `PAYMENT-SIGNATURE` since WO-02, and `PAYMENT-RESPONSE` has always been emitted, so §1.2 held. What did not: the 402 body's `error` field still read `"X-PAYMENT header is required"`, the platform-wide default from [api/_lib/x402-spec.js](../api/_lib/x402-spec.js), on every OKX row including the four listed forge services. A reviewer of an x402-**v2** listing read a **v1** header name in the one string an unpaid call is guaranteed to surface. Closed by `X402_HEADER_ERROR` in [api/_lib/x402-xlayer-okx.js](../api/_lib/x402-xlayer-okx.js), threaded into every OKX challenge, naming both headers with v2 first; the shared default is unchanged for the Solana and Base rails, which really do read `X-PAYMENT`. Pinned by [tests/api/okx-402-dialect.test.js](../tests/api/okx-402-dialect.test.js). Ships on the next deploy.+> **Note (2026-09-02, WO-07 audit): the last v1 string is gone.** The header *reading* has accepted `PAYMENT-SIGNATURE` since WO-02, and `PAYMENT-RESPONSE` has always been emitted, so §1.2 held. What did not: the 402 body's `error` field still read `"X-PAYMENT header is required"`, the platform-wide default from [api/_lib/x402-spec.js](../api/_lib/x402-spec.js), on every OKX row including the four listed forge services. A reviewer of an x402-**v2** listing read a **v1** header name in the one string an unpaid call is guaranteed to surface. Closed by `X402_HEADER_ERROR` in [api/_lib/x402-xlayer-okx.js](../api/_lib/x402-xlayer-okx.js), threaded into every OKX challenge, naming both headers with v2 first; the shared default is unchanged for the Solana and Base rails, which really do read `X-PAYMENT`. Pinned by [tests/api/okx-402-dialect.test.js](../tests/api/okx-402-dialect.test.js). **Shipped and live**, re-read off production 2026-09-09: an unpaid `POST /api/okx/3d/forge-draft` answers 402 whose body `error` reads `"PAYMENT-SIGNATURE header is required (X-PAYMENT is also accepted)"`.> **Correction (2026-07-23, Work Order 07 final audit):** the "our payTo" address stated throughout this spec, `0x75d00a2713565171f33216e5aa2a375e076ecf69`, is **no longer what production advertises**. Live probe of `POST /api/okx/3d/text-to-3d` today returns `accepts[0].payTo = 0x4022de2D36C334E73C7a108805Cea11C0564f402` on `eip155:196` (confirmed against the Cloud Run service's live `X402_PAY_TO_XLAYER` env var). That address is the platform's standing EVM merchant/deployer wallet, already the `payTo` for the Base rail (see `contracts/DEPLOYMENTS.md`) and now consolidated onto X Layer too, sometime between 2026-07-07 and 2026-07-23 (no PROGRESS.md entry recorded the change; not a WO-07 regression). `0x75d0…cf69` remains agent #2632's **on-chain identity owner wallet** (the ERC-8004 registration) and the **onchainos buyer/TEE wallet** used to sign test payments, those roles are unaffected, only the payment-recipient address changed. Funding instructions in [`prompts/finish/_context/okx-ai-RUNBOOK.md`](../prompts/finish/_context/okx-ai-RUNBOOK.md) have been corrected to the live address; every `0x75d0…cf69`-as-payTo reference below (§1 examples, Appendix D, the table in §5) is now historical evidence of what was true on the date it was captured, not the current live value. Re-verify `payTo` live before any future funding request.diff --git a/tests/api/okx-identity-studio.test.js b/tests/api/okx-identity-studio.test.jsindex e75d625f2..e726f3524 100644--- a/tests/api/okx-identity-studio.test.js+++ b/tests/api/okx-identity-studio.test.js@@ -301,6 +301,40 @@ describe('free lanes over HTTP', () => {expect(rail.token).toBe('USD₮0');});+ // `settleable` used to answer "is a settlement route configured", which is+ // not what a buyer reading this page is asking. With no OKX facilitator+ // credentials the relayer redeems the authorization itself and pays the gas,+ // so a relayer with an empty OKB balance turns a collected payment into a 502+ // at settle time while /health still read green.+ it('GET /health reports the relayer gas reading, not just that a route is configured', async () => {+ mountHealthyProbes();+ const res = makeRes();+ await handler(makeReq({ method: 'GET', service: 'health' }), res);+ const rail = JSON.parse(res.body).subsystems.find((s) => s.name === 'payment-rail');+ expect(rail.ok).toBe(true);+ expect(rail.settleable).toBe(true);+ expect(rail.relayer_funded).toBe(true);+ });++ it('GET /health fails the payment rail when the settlement relayer is out of gas', async () => {+ mountHealthyProbes();+ fetchRoutes.rpc = (url, init) => {+ const rpc = jsonRpcBody(init);+ if (rpc?.method === 'eth_getBalance') return jsonResponse(200, { jsonrpc: '2.0', id: rpc.id, result: '0x0' });+ return healthyXlayerRpc(url, init);+ };+ const res = makeRes();+ await handler(makeReq({ method: 'GET', service: 'health' }), res);+ expect(res.statusCode).toBe(503);+ const body = JSON.parse(res.body);+ expect(body.ok).toBe(false);+ const rail = body.subsystems.find((s) => s.name === 'payment-rail');+ expect(rail.ok).toBe(false);+ expect(rail.settleable).toBe(false);+ expect(rail.relayer_funded).toBe(false);+ expect(rail.error).toMatch(/out of gas/);+ });+it('GET /health goes 503 when a subsystem is down — never a hardcoded ok', async () => {fetchRoutes.render = () => new Response(null, { status: 500 });fetchRoutes.forgeSubmit = () => jsonResponse(200, FORGE_CATALOG);