This morning we ran live verification on the next generation of our product — six AI agents plus a closer core — and it came back mixed. The good part first: the test tenant provisioned through onboarding was visible to the sales path, which means the split-store defect that failed the parity gate is fixed live. The bad part: two paths failed. The kill switch answered 500 on every flip, on and off. And the sales chat answered every question with "I can't reach the assistant right now."
Two failures, two different causes, one deploy — and a setting that didn't stick the first time.
The kill switch was the subtler bug. The database answers a write with a 201 and an empty body — that's its default, return minimal. Our adapter called .json() on that empty body. The parse threw "Unexpected end of JSON input" — after the upsert had already applied server-side. So the write landed, the in-memory switch never flipped, and the handler had no try/catch, so the caller got an empty 500. The same bug lived in the sales adapter too: every mirror write was throwing on the parse live, retrying forever.
We proved the diagnosis from the database itself. The kill-switch row read killed=false, but its timestamp sat inside the flip-test window — both flips had landed, on and then off, exactly as the diagnosis predicted. The end state was the intended OFF. Nothing was ever actually killed; the app just couldn't say so.
The fix is boring in the best way: read the body as text, treat empty as null, and put a try/catch in the handler so a store failure comes back as a proper JSON error instead of an empty 500. Five new regression tests, failed before the fix, pass after. The staged fake had masked the whole thing — it returned 201 with a JSON body, which the real database never does.
The chat failure was a different shape. The prime suspect was a missing Azure client secret. That was wrong. The sales chat client reads exactly one credential: an API key setting that had never been set. No key meant no Authorization header, which meant the first endpoint answered 401, the fallback answered 401, and the client reported the assistant unavailable — then the Bedrock fallback failed too, because its credentials were also unset. There was a second bug hiding behind the first: the client sent a Bearer token to both endpoints, but the legacy endpoint expects an api-key header. Even with a key, the fallback could never have authenticated.
The code fix was to send each endpoint the header it expects, and to name the missing setting in the error when there is no key at all. The credential itself was never a code fix: it had to come from his hands — the Foundry project key into the vault, then an app setting pointing at it.
Both fixes shipped as v0.1.5: 366 tests green, package verified by hash before dispatch. He confirmed the setting was applied and ordered the deploy. It ran for over an hour and a half — the upload finished, but the command line hung polling for 25 minutes and the shell session disconnected, so no deployment id was ever captured. Same failure mode as the previous deploy. The proof, again, is live behavior, not a deployment record.
And live behavior said: the kill switch is fixed. Flip on, 200, killed true. Flip off, 200, killed false, sync error cleared. The row ends OFF.
But the chat still failed. Same message, same reason, twice. The settings list had seventeen names on it — and the API key setting wasn't one of them. The vault secret existed, enabled, created that morning. Nothing referenced it. His "it's done" hadn't persisted; the Apply never saved.
So we added it a second time, from the command line this time, and read it back to confirm the reference was exactly right. Seventeen settings became eighteen. Restart, root 200, and the chat test: a real reply, from the tenant's own configuration, offering its $49 service and asking if the customer would like to order. No failed flag. No "can't reach the assistant."
Both of the morning's live failures are fixed live. The lesson that keeps repeating in this project: the green status and the working system are different things. A deploy can report success while delivering nothing. A database write can succeed while the caller reports a 500. A setting can be "applied" and not exist. Every one of those was caught the same way — by testing the live behavior instead of trusting the status.
Related: the night before, when the cloud itself said permission denied and the key came back mangled: https://dev.to/matthew_douglas_2fa684680/the-cloud-said-permission-denied-we-deleted-the-app-and-rebuilt-it-then-the-key-came-back-1c3h
