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 #5437

Parked opened this
Closed without merging

I added the backupstest MCP tool, but the "reached" test could not pass in my sandbox. It blocks the S3 client's loopback connection to the fake bucket, so that test failed here. The other two cases and test/mcp.test.ts, test/mcp-docs.test.ts and test/mcp-size.test.ts pass.

Notes

stopped parked by the crew deploy 50b7a6d

opened this

I added the backups_test MCP tool, but the "reached" test could not pass in my sandbox. It blocks the S3 client's loopback connection to the fake bucket, so that test failed here. The other two cases and test/mcp.test.ts, test/mcp-docs.test.ts and test/mcp-size.test.ts pass. I did not get a clean tsc run: the type check found no types for bun, so it is unverified.

What changed

  • The tool: it takes endpoint, bucket, region, accessKey and secretKey, trimmed and blank when absent, as the page's form does. It calls testDestination(ctx.app, user, input) and answers { reached, says }, where says is the action's own sentence. The access key and secret key are not echoed back.
  • Admin and write marking: a non-admin gets not_found: Not found., the page's refusal. The tool is marked as a write in tools/list's annotations like the other writes. It sits after board_delete; none of #5415, #5422 or #5423 had landed.
  • Docs and the tool list: one row in docs/MCP.md, and backups_test added to the expected tool list in test/mcp.test.ts.
  • test/mcp-backups-test.test.ts: three cases. A "local" destination (a loopback server answering an empty bucket listing) is reached. An unreachable one says why. A non-admin is refused. The first two check that neither secret appears in the answer.

What to look at

  • Description cuts: test/mcp-size.test.ts has a hard 37,000-byte headroom, and the new tool pushed tools/list about 300 bytes over it. I did not raise the ceiling. Instead I shortened about 25 other tool descriptions in src/http/mcp.ts by a few words each, dropping low-value tails such as "Writers." or "nothing else is copied". No tool's behaviour changed, and every test in test/mcp* other than the reached case passes.
  • The reached test: run it in the forge's check, which has no such block.
  • No local-directory destination: testDestination only knows S3 targets, so "local" in the issue means a loopback S3-style endpoint. Adding a directory destination to the action was beyond this issue.

Closes #5428

commented

I added the backups_test MCP tool, but the "reached" test could not pass in my sandbox. It blocks the S3 client's loopback connection to the fake bucket, so that test failed here. The other two cases and test/mcp.test.ts, test/mcp-docs.test.ts and test/mcp-size.test.ts pass. I did not get a clean tsc run: the type check found no types for bun, so it is unverified.

What changed

  • The tool: it takes endpoint, bucket, region, accessKey and secretKey, trimmed and blank when absent, as the page's form does. It calls testDestination(ctx.app, user, input) and answers { reached, says }, where says is the action's own sentence. The access key and secret key are not echoed back.
  • Admin and write marking: a non-admin gets not_found: Not found., the page's refusal. The tool is marked as a write in tools/list's annotations like the other writes. It sits after board_delete; none of #5415, #5422 or #5423 had landed.
  • Docs and the tool list: one row in docs/MCP.md, and backups_test added to the expected tool list in test/mcp.test.ts.
  • test/mcp-backups-test.test.ts: three cases. A "local" destination (a loopback server answering an empty bucket listing) is reached. An unreachable one says why. A non-admin is refused. The first two check that neither secret appears in the answer.

What to look at

  • Description cuts: test/mcp-size.test.ts has a hard 37,000-byte headroom, and the new tool pushed tools/list about 300 bytes over it. I did not raise the ceiling. Instead I shortened about 25 other tool descriptions in src/http/mcp.ts by a few words each, dropping low-value tails such as "Writers." or "nothing else is copied". No tool's behaviour changed, and every test in test/mcp* other than the reached case passes.
  • The reached test: run it in the forge's check, which has no such block.
  • No local-directory destination: testDestination only knows S3 targets, so "local" in the issue means a loopback S3-style endpoint. Adding a directory destination to the action was beyond this issue.
commented

Parked by the crew: the check failed ("/system over server-sent events > the sampler's clock runs only while someone watches, and ticks while they do") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs