Wink Pings

10.21 seconds, 3 candidate fixes tested in parallel, 0 sandbox residue

A real run on GMI AgentBox: take a snapshot, fork 3 sandboxes in parallel, and test 3 candidate fixes simultaneously. Results in 10.21 seconds, winning patch automatically saved, all resources deleted.

3 candidate code fixes, tested in parallel in cloud sandboxes, all finished in 10.21 seconds. The patch that passed all 12 tests won, diff saved, all sandboxes deleted, 0 leftovers. This is the result of a live run (real cloud environment run) on the GMI AgentBox platform.

Cloud sandboxes are one-off environments in the cloud, deleted after use. Workflow: first start a base sandbox, upload code and test files, install git and pytest (Python's testing framework), confirm the baseline is 8 tests passing, 4 failing. Then save a snapshot and fork 3 sandboxes in parallel from the snapshot. A snapshot is a complete copy of the environment; forked sandboxes are independent of each other, each with its own filesystem.

Each fork automatically applies a different patch, then runs pytest. From startup to completion, the 3 forks actually took 10.21 seconds.

Results:

  • Fork A (naive clamp): 10 passed, 2 failed
  • Fork B (eager reset): 11 passed, 1 failed
  • Fork C (precise accounting): 12 passed, 0 failed, winner

This project is a token bucket rate limiter. Without the patch, 8 passed, 4 failed. Patch C fixed 4 defects:

  • Idle bucket accumulation exceeds capacity limit
  • Fractional refill is truncated by int(), losing decimals
  • Rejected requests consumed tokens
  • Clock rollback causes tokens to become negative

The winning patch was automatically saved as winning_fix.patch. The whole process took 68.34 seconds, including final cleanup: deleting the 3 fork sandboxes, snapshot, and base resources, confirming 0 active sandboxes.

The developer recorded two real-world lessons learned from pitfalls.

Code should be placed under /workspace. Previously it was placed in /tmp; after snapshot restore, all 3 forks reported that the directory did not exist. /tmp is not persistent in snapshots.

When executing shell commands in the sandbox, try to use simple && chains. Previously a compound expression with if conditions and redirection was used, and an edge WAF returned 403. Switching to a chained form like apt-get update && apt-get install -y -qq git && pip install pytest passed normally.

Before running live, you can first run 73 offline tests and a dry-run, without creating any real resources, to validate the orchestration logic.

image

Full code, patches, run logs, and cost records are in the GitHub repository. Media generation cost was about $8.3; live sandbox runs showed no change on cent-precision billing.

Before opening a PR, would you run a parallel race among candidate fixes?

发布时间: 2026-11-24 01:34