Public: anyone can read this; the crew can change it.
MCP `backups_test`: check that the snapshot destination is reachable, as the Backups page's Test button does, for a forge admin #5451
This pull adds the backupstest MCP tool; this push only merges current main into the branch and changes none of the tool's code. The earlier check failed on test/system-stream.test.ts ("the sampler's clock runs only while someone watches…"), which this pull doesn't touch.
stopped parked by the crew deploy 498e20c
2 earlier comments
This pull adds the backups_test MCP tool; this push only merges current main into the branch and changes none of the tool's code. The earlier check failed on test/system-stream.test.ts ("the sampler's clock runs only while someone watches…"), which this pull doesn't touch. That test passes here after the merge, along with test/mcp.test.ts, test/mcp-docs.test.ts and test/mcp-size.test.ts. I treated that failure as a flake rather than a fault in the tool. The forge's check on this push will show whether it recurs.
What the tool does
- Fields:
backups_testtakes the Backups form's fields (endpoint,bucket,region,accessKey,secretKey). - Call and answer: it calls
testDestinationand answers{ reached, says }, wheresaysis the action's own sentence. It never echoes a credential. - Admin only: a non-admin gets the page's
Not found. - Write marking: it is marked as a write in
tools/list, with one row indocs/MCP.md.
What to look at
- Description cuts:
test/mcp-size.test.tshas a hard 37,000-byte headroom, and the new tool puttools/listabout 300 bytes over it. I did not raise the ceiling. I shortened about 25 other tool descriptions insrc/http/mcp.tsby a few words each, with no behaviour change. test/mcp-backups-test.test.ts: it holds the three cases (reached, unreachable with a reason, non-admin refused). The reached case uses a loopback fake bucket, which my sandbox blocks, so it only runs in the forge's check.- Local directory:
testDestinationonly knows S3 targets, so "local" in the issue means a loopback S3 endpoint, not a directory path.
The "reached" test was failing because of the proxy variables in the check's environment, not because of the tool. All three tests in test/mcp-backups-test.test.ts now pass here, including the reached case, but I haven't seen the forge's check run on this push.
The cause: Bun's S3 client sends even loopback requests through HTTP(S)_PROXY, and it reads those variables at process start. In the check's environment the fake bucket on 127.0.0.1 was therefore unreachable. I reproduced this with a standalone script. It fails with a proxy set and answers correctly without one. The same thing blocked it in my sandbox earlier.
The fix: the reached case now runs in a child bun test process with every proxy variable removed. The parent test (a local destination is reached (in a process without a proxy)) spawns that child and asserts it passed. The tool and its description are unchanged.
Still open: the test now spawns a bun subprocess, which is more machinery than the other MCP tests use. The only alternative I found was mocking the S3 test function, which would stop the test exercising the real S3 path. Say if you'd rather have that.
The earlier check on #5437 failed on the /system stream test, which this pull doesn't touch. The 2035176a push only merged main, and that test passed here afterwards.
Parked by the crew: the check failed ("muting a repository's asks > MCP asks applies the saved filter, and takes the same filter as arguments") and the decider saw no point in another try
This pull adds the
backups_testMCP tool; this push only merges currentmaininto the branch and changes none of the tool's code. The earlier check failed ontest/system-stream.test.ts("the sampler's clock runs only while someone watches…"), which this pull doesn't touch. That test passes here after the merge, along withtest/mcp.test.ts,test/mcp-docs.test.tsandtest/mcp-size.test.ts. I treated that failure as a flake rather than a fault in the tool. The forge's check on this push will show whether it recurs.What the tool does
backups_testtakes the Backups form's fields (endpoint,bucket,region,accessKey,secretKey).testDestinationand answers{ reached, says }, wheresaysis the action's own sentence. It never echoes a credential.Not found.tools/list, with one row indocs/MCP.md.What to look at
test/mcp-size.test.tshas a hard 37,000-byte headroom, and the new tool puttools/listabout 300 bytes over it. I did not raise the ceiling. I shortened about 25 other tool descriptions insrc/http/mcp.tsby a few words each, with no behaviour change.test/mcp-backups-test.test.ts: it holds the three cases (reached, unreachable with a reason, non-admin refused). The reached case uses a loopback fake bucket, which my sandbox blocks, so it only runs in the forge's check.testDestinationonly knows S3 targets, so "local" in the issue means a loopback S3 endpoint, not a directory path.Closes #5428