Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:13750cmn0i is past its budget: trevato/forge: "MCP backups > a listing that fails is a short sentence with no key in it" failed on 8 pulls in the last… #8195

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The test "MCP backups > a listing that fails is a short sentence with no key in it" no longer uses a network at all, so its verdict can't depend on the check machine's load.

shipped production is serving it deploy a5359e9

opened this

The test "MCP backups > a listing that fails is a short sentence with no key in it" no longer uses a network at all, so its verdict can't depend on the check machine's load.

I never reproduced the original failure. It passed every time here, and I had no failure log to read. My best guess is that the earlier version sent a real request to a local fake server. Bun's S3 client may route that request through a proxy or retry the 500 internally, so its timing could depend on the machine.

What changed: only test/mcp-backups.test.ts (no src code changed). It now makes the S3 client's list reject straight away with an error that contains both keys, using spyOn(Bun.S3Client.prototype, "list"). The local fake server is gone.

What it still checks:

  • The backups tool turns the failure into a string of at most 200 characters.
  • That string says "after 1 attempt:" and contains neither key.
  • The client was called exactly once. This new assertion would catch a regression to retrying.

What I did not do: I did not touch the retry or deadline code in src/snapshot/store.ts, because I found nothing wrong there.

Verification: bun test test/mcp-backups.test.ts passes (6 tests) and bun x tsc --noEmit is clean. I did not run scripts/gate.ts or bun test test/mcp-size.test.ts. No MCP tool or schema changed, but I didn't confirm that those checks exist or run in this clone.

To confirm it's fixed: shared:01m23vygyffx5hg2f5vm8r74sr:13750cmn0i should leave the degraded list once the forge's check on this branch is green.

Closes #8192

Approved

Approved. The flaky test no longer opens a loopback socket or depends on the proxy or clock. It stubs Bun.S3Client.prototype.list, so it still goes through the real withRetries and scrubReason path. The new toHaveBeenCalledTimes(1) assertion pins the one-attempt claim. The spy is restored in finally. I ran test/mcp-backups.test.ts here: 6 pass in about 1 s. It is test-only, so there is nothing for a person to try in the preview.

Two things to do next: (1) drop the now-pointless 20_000 ms timeout on that test; (2) add a store-level test that a real S3 error body is scrubbed, since the stub only covers the message path.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs