Gemini 504s and a wrong TACG rollback
EngineeringDec 4, 2026Updated Dec 5, 20266 min read
Two of my projects had incidents on Nov 10, 2026. On Priestess, a fix for slow safety-check calls made them fail more often. On TACG, a release was rolled back for a stall that the previous release also had.
38 of 73 Priestess turns with an HTTP 504 Nov 10, 2026
78 to 0 HTTP 504s across 322 paired calls with and without the header, Nov 10, 2026
34 min TACG r61 live before the rollback Nov 10, 2026
How this was builtClaude Code and OpenAI Codex wrote the code on both projects and ran the release watches described here. I set the architecture, the safety priorities, and the release rules. Agents acted under my standing rules while I was away in both incidents: on Priestess they kept the distress model and shipped the header fix, and on TACG they rolled back r61 and shipped the loader fix.
01Priestess: the fix that made it worse
Before Priestess writes anything, three safety checks run in parallel. One of them looks for a member in distress, and it runs on Gemini 3.8 Flash. When that call fails, it is retried and the reply is slower.
Distress-check failures after launch (Eastern time)
- Nov 8, 20:22
3 of the first 26 live turns
The live log watch saw a failed distress-check call on 3 turns in the first 90 minutes. All 3 recovered on retry, about 8 s slower each.
- Nov 9
21 of 92 turns
The 24-hour check counted a failed call on 21 of 92 turns.
- Nov 10, about 02:10
First fix goes live
The first try was capped at 3.6 s so that a slow call would fail fast and retry sooner.
- Nov 10, 19:25
38 of 73 turns
The next 24-hour check found HTTP 504 on 38 of 73 turns (Nov 9 19:04 to Nov 10 19:04 ET). The cap had made it worse.
- Nov 10, 19:58
I ask for a smaller model
I told the agents to move the check to Gemini 3.5 Flash-Lite. In testing it missed 2 of 22 distress conversations, so it did not ship.
- Nov 10, 22:01
Second fix goes live
Engine revision 15 removed the server deadline header. The first 3 live turns after it had no distress-check errors.
02Finding the header
The first fix set a 3.6 s request timeout in the google-genai Python SDK. The SDK also sends that timeout to the server as a header, rounded up to whole seconds: X-Server-Timeout: 4. The server then ended slow calls itself and answered HTTP 504. In the test below, those 504s came back after 1.56 to 3.47 s.
The agent tested this with paired calls. Each of 322 test items was sent twice, once with the SDK timeout and once with no server deadline and a 10 s cutoff on the client.
Of the 78 calls that returned 504 with the header, 66 returned 200 without it and 12 were cut by the client. No call returned 504 without the header. The other 14 calls cut by the client had not returned 504 with it.
The second fix removed the SDK timeout, which removed the header, and enforced the deadline on the client with two tries limited to 6.5 s and 10 s. On the first 3 live turns after the release, the distress check took 1.4 to 2.1 s.
I was away when the test finished. The agent kept the check on Gemini 3.8 Flash, citing my Oct 3 choice of that model for distress, and shipped the header fix through the normal staged release.
Also that nightAt 21:56 ET the prepaid OpenRouter account that pays for the Claude and DeepSeek calls ran out of credit. 2 turns got HTTP 402 before an agent's post-release check found it. I topped the account up by 23:02 ET.
03TACG: rolling back a release that was not the cause
TACG is my browser version of That Arknights Card Game, a fan-made Arknights card game. Releases are numbered rounds. r59 went live at 23:13 on Nov 9, 2026 and r61 followed about 4 hours later.
Nov 10, 2026 (Eastern time)
- 03:10
r61 goes live
By then r59 had logged 1 loading stall in its 4 hours live.
- 03:38
1 stall in the first half hour
22 pages finished loading, 0 failed, and 1 stalled on the loading screen while waiting on a stylesheet. The agent on watch logged it as a follow-up and noted that the wait code had not changed since r59.
- 03:44
Rollback to r59
3 stall alerts in 12 minutes with the same signature (03:31, 03:39, 03:43), against 1 in the previous 4 hours on r59. A 4th arrived as the agent rolled r61 back. Stalled pages reloaded themselves and stalled again, which raised the count.
- 03:51
Mechanism reproduced
A local script reproduced the stall with a stylesheet link that had no address.
- 04:09
Same stall on r59
r59 logged 2 more stalls with the same signature, at 04:09 and 04:10, about 25 minutes after the rollback. The 3 alerts before the rollback had come from 2 players, one of them reloading.
- 05:21
r61 and the loader fix go live
About 96 minutes after the rollback. A 30-minute stall watch followed.
r61 was live for 34 minutes and then off for about 96 minutes. The rollback changed nothing for the affected players.
04The cause: an extension filter added in r59
The loading screen watches the page head and waits for every game stylesheet to finish loading. r59 had added a filter so that stylesheets injected by browser extensions would be ignored. A function, gameFile(), resolves each address against the page's base URL with new URL() and keeps only same-origin game paths.
On the stalled pages, a stylesheet link with no address had been added during startup. An empty address resolves to the base URL itself, which is a game path. The filter written to ignore extension stylesheets classified this one as a game file. The stall report showed 3 files pending, 0 marked foreign, and 0 failed. A link with no address never fires a load event, so the loading screen never cleared.
- Added during startup<link rel="stylesheet">No address
- gameFile()new URL()The empty address resolves to the base URLExtension filterClassified as a game fileStall report: 3 files pending, 0 marked foreign, 0 failedLoading screenWaits for a load eventA link with no address never fires oneResultThe loading screen never clears
- gameFile()Rejects the empty stringBefore it calls new URL()LoaderLink left untrackedTracked later if it gets an addressEnd-to-end test, same buildReady in 2.5 s
No game code adds a link like that. A browser setup or extension is the likely source, and I have not confirmed which. The player who stalled in Chrome loaded the game normally in Edge.
The fix went live as r61b at 05:21 and changed four things.
- gameFile() rejects non-strings and empty or whitespace-only strings before it calls new URL().
- The loader reads the raw href and src attributes. The DOM .href property reports the base URL when href is empty.
- A stylesheet link with no address is left untracked.
- The observer on the page head also watches href and rel changes, so a link that gets an address later is still tracked.
It shipped with unit tests (boot-loader.test.mjs) and a real-browser end-to-end test (boot-bare-link.cjs, 4 scenarios) that injects a bare stylesheet link and an href="" link during startup. With both loaders run on the same build, the old one stalled with the signature seen live and the new one was ready in 2.5 s. The release passed the full ship check: 16 of 16 smoke, 70 of 70 menu, and 46 of 46 online checks at widths of 1280 and 1920 px.
05What the two incidents had in common
- Both first responses acted on an untested assumption. On Priestess the first fix assumed the calls were slow and capped them, and the shorter cap made the 504s far worse. On TACG the rollback assumed r61 was the cause, and the stall came from a filter added in r59.
- Both were settled by a paired test: 322 calls sent with and without the header, and one build run with the old and the new loader.
- On TACG the evidence against the rollback was already in the log. The 03:38 note said the wait code was unchanged since r59, and the rollback happened minutes later on a count of 3 alerts from 2 players.