<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mikhail4AI on Medium]]></title>
        <description><![CDATA[Stories by Mikhail4AI on Medium]]></description>
        <link>https://medium.com/@mikhail4ai?source=rss-7cc2b4cfb16b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MHGa00k3XCBqKLWFQgvjbQ.png</url>
            <title>Stories by Mikhail4AI on Medium</title>
            <link>https://medium.com/@mikhail4ai?source=rss-7cc2b4cfb16b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:15:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mikhail4ai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A timed-out tool call may have already changed the world]]></title>
            <link>https://medium.com/@mikhail4ai/a-timed-out-tool-call-may-have-already-changed-the-world-beba0a678fb2?source=rss-7cc2b4cfb16b------2</link>
            <guid isPermaLink="false">https://medium.com/p/beba0a678fb2</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Mikhail4AI]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 01:42:08 GMT</pubDate>
            <atom:updated>2026-11-23T01:42:08.630Z</atom:updated>
            <content:encoded><![CDATA[<p>An agent asks a reporting service to create an export. The service writes the report, then the connection drops before the response reaches the caller. The caller sees a timeout. The report exists.</p><p>Retrying the same HTTP request can now create a second report. A backoff changes when that happens; it does not change whether the operation is safe to repeat.</p><p>This failure is easy to miss in tests that throw an exception before a write. To reproduce it, inject the failure after the remote commit and before the response is delivered.</p><h3>Reproduce the duplicate</h3><p>The script below, saved as lost-response-demo.py, uses an in-memory reporting service. Its create method appends a report before optionally raising TimeoutError. It deliberately has no idempotency implementation.</p><pre>&quot;&quot;&quot;Offline illustration: a lost response is not evidence of a failed write.&quot;&quot;&quot;<br>import json<br>class ReportService:<br>    def __init__(self):<br>        self.reports = []<br>    def create(self, operation_id, lose_response=False):<br>        report = {&quot;id&quot;: f&quot;report-{len(self.reports) + 1}&quot;, &quot;operation_id&quot;: operation_id}<br>        self.reports.append(report)<br>        if lose_response:<br>            raise TimeoutError(&quot;Response lost after remote commit&quot;)<br>        return report<br>    def lookup(self, operation_id):<br>        return [report for report in self.reports if report[&quot;operation_id&quot;] == operation_id]<br>def dispatch(service, operation_id):<br>    try:<br>        return {&quot;state&quot;: &quot;completed&quot;, &quot;result&quot;: service.create(operation_id, True)}<br>    except TimeoutError:<br>        return {&quot;state&quot;: &quot;unknown&quot;, &quot;operation_id&quot;: operation_id}<br>def reconcile(service, operation):<br>    matches = service.lookup(operation[&quot;operation_id&quot;])<br>    if len(matches) == 1:<br>        return {&quot;state&quot;: &quot;completed&quot;, &quot;result&quot;: matches[0], &quot;source&quot;: &quot;remote_lookup&quot;}<br>    return {**operation, &quot;state&quot;: &quot;unknown&quot;}<br>def main():<br>    unsafe = ReportService()<br>    dispatch(unsafe, &quot;export-42&quot;)<br>    unsafe.create(&quot;export-42&quot;)<br>    assert len(unsafe.reports) == 2<br>    safe = ReportService()<br>    operation = dispatch(safe, &quot;export-42&quot;)<br>    assert operation[&quot;state&quot;] == &quot;unknown&quot;<br>    settled = reconcile(safe, operation)<br>    assert settled[&quot;state&quot;] == &quot;completed&quot;<br>    assert len(safe.reports) == 1<br>    assert reconcile(safe, operation) == settled<br>    missing = reconcile(ReportService(), operation)<br>    assert missing[&quot;state&quot;] == &quot;unknown&quot;<br>    ambiguous = reconcile(unsafe, operation)<br>    assert ambiguous[&quot;state&quot;] == &quot;unknown&quot;<br>    print(json.dumps({&quot;blind_retry_reports&quot;: len(unsafe.reports),<br>                      &quot;reconciled_reports&quot;: len(safe.reports),<br>                      &quot;missing_lookup&quot;: missing[&quot;state&quot;],<br>                      &quot;ambiguous_lookup&quot;: ambiguous[&quot;state&quot;],<br>                      &quot;repeated_reconciliation&quot;: &quot;same result&quot;,<br>                      &quot;scope&quot;: &quot;offline illustration, not Hexagon integration acceptance&quot;}, indent=2))<br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>Run it with Python 3; no packages, account, or model are required:</p><pre>python3 lost-response-demo.py</pre><p>The first case submits an operation, loses its response, and submits it again. Two reports exist. The second case records the uncertain operation and looks up its result before deciding what to do. One report exists.</p><pre>{<br>  &quot;blind_retry_reports&quot;: 2,<br>  &quot;reconciled_reports&quot;: 1,<br>  &quot;missing_lookup&quot;: &quot;unknown&quot;,<br>  &quot;ambiguous_lookup&quot;: &quot;unknown&quot;,<br>  &quot;repeated_reconciliation&quot;: &quot;same result&quot;<br>}</pre><p>These are results from a small offline illustration. They say nothing about a particular provider’s delivery guarantees or a live Hexagon deployment.</p><h3>Give uncertainty a state</h3><p>A useful operation record distinguishes a confirmed failure from an unknown outcome. Store the operation’s identity and immutable request before dispatch. After dispatch, keep any receipt that can help identify the remote result.</p><p>For the export above, the next action is a lookup using the original operation identity. A unique, matching report can establish completion. A lookup that returns nothing may still be inconclusive: the remote service might have delayed visibility, or the original request might still be running. Multiple matches require investigation too. Neither result is permission to declare success.</p><p>The example leaves both cases unknown. Its lookup is intentionally simpler than a production reconciliation path, which also needs authorization, request matching, durable storage, and protection against concurrent workers.</p><h3>An idempotency key only works where it is enforced</h3><p>Adding a key to a request does not make the receiving service deduplicate it. Check the endpoint’s actual contract: which operations accept keys, their scope, how long they are retained, and what happens when a key is reused with different input.</p><p>If the endpoint provides that guarantee, preserve the original key and payload for a retry. If it does not, use a supported lookup or an operator’s verified result. Some services expose neither. In that case, a workflow needs a way to remain unresolved without silently issuing the write again.</p><p>An agent can explain the uncertainty, but its confidence is not evidence that the report exists.</p><h3>How this maps to Hexagon</h3><p>For tools dispatched through its control-plane broker, Hexagon’s tool-reconciliation documentation describes an unknown state and a tool.outcome_unknown event for uncertain external writes. Its resolution API records an externally checked result; it does not send another request to the remote service.</p><p>The caller supplies the original request hash, the established outcome, and an explanation of the evidence. The stored result is marked caller_verified, which distinguishes an operator&#39;s conclusion from a direct response. If the outcome remains uncertain, the documented path is to leave it waiting or cancel the Run. Cancellation itself cannot retract a remote write that has already happened.</p><p>This mechanism concerns tool-result recovery. It is separate from reconnecting an event stream: replaying a stored progress event should not execute the underlying tool again.</p><p>Source: <a href="https://github.com/NexusFox88/Hexagon/blob/main/docs/tool-reconciliation.md">Hexagon tool reconciliation</a>.</p><h3>Put the failure after the write</h3><p>For an agent integration that changes external state, test these cases explicitly:</p><ul><li>The service commits a write, but its response is lost.</li><li>A lookup finds one matching result, no result, or several candidates.</li><li>The same reconciliation is requested twice.</li><li>A worker restarts while the operation is unresolved.</li><li>Cancellation arrives after dispatch.</li></ul><p>The included script covers the first three. Restart and cancellation need tests against your real persistence and worker lifecycle. A happy-path tool test cannot establish those behaviors.</p><p>If you are investigating a duplicate tool action, start with the remote record and the original operation identity. A second request is another side effect, not a diagnostic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=beba0a678fb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A saved cursor can hide an event you never stored]]></title>
            <link>https://medium.com/@mikhail4ai/a-saved-cursor-can-hide-an-event-you-never-stored-1ad1f2e3afa8?source=rss-7cc2b4cfb16b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ad1f2e3afa8</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Mikhail4AI]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 10:17:59 GMT</pubDate>
            <atom:updated>2026-11-21T10:42:33.208Z</atom:updated>
            <content:encoded><![CDATA[<p>An event consumer has two writes to make: save the event, then save the position it will resume from. The failure between those writes is small enough to miss in a happy-path test.</p><p>Suppose event 9 arrives. If the consumer saves its cursor as 9 and crashes before storing the event, a restart asks for events after 9. The missing row stays missing. Reversing the writes changes the failure: the event may be stored while the cursor remains at 8, so event 9 arrives again after restart.</p><p>The second case is recoverable if replay is safe. The first one needs more than a reconnect button.</p><h3>Put the two writes in one transaction</h3><p>The SQLite example in Hexagon’s documentation keeps an events table and a cursors table. Each event has a composite primary key: the run ID and the event ID. The consumer inserts the row and updates that run’s cursor in the same transaction.</p><pre>BEGIN IMMEDIATE;<br>-- Check whether this run/event pair is already stored.<br>-- Insert the event if it is new.<br>-- Advance the cursor for this run.<br>COMMIT;</pre><p>The comments matter here: this is the transaction shape, not a complete replacement for the implementation. Before inserting, the example checks whether the event is already present. An identical replay returns without adding a row. A replay with different content raises an error. Silently accepting two payloads under one event ID would hide a source or storage problem.</p><p>It also rejects an unseen event whose ID is behind the saved cursor. That check assumes one ordered consumer per run. If several workers consume the same run independently, that assumption needs a different coordination design.</p><h3>Fail the checkpoint write on purpose</h3><p>The useful test is not just closing and reopening SQLite after a successful commit. Make the checkpoint write fail after the event insert has happened.</p><p>The example installs a trigger for a test run:</p><pre>CREATE TRIGGER fail_checkpoint BEFORE INSERT ON cursors<br>WHEN NEW.run_id=&#39;rollback-demo&#39; BEGIN<br>  SELECT RAISE(ABORT, &#39;simulated cursor write failure&#39;);<br>END;</pre><p>The consumer catches the failure and rolls back. The test then checks both tables: the cursor is still zero, and there are no event rows for that run. A test that checked only the exception would miss an event left behind by a broken transaction boundary.</p><p>You can run the example with Python’s standard library:</p><pre>git clone https://github.com/NexusFox88/hexagon-docs.git<br>cd hexagon-docs<br>python3 -B resources/examples/documentation/event-checkpoint.py</pre><p>The script uses a temporary database and removes it when finished. Its checks cover restart, identical replay, conflicting replay, large IDs, gaps between IDs, run isolation, and the failed checkpoint transaction. These are offline SQLite checks. They do not exercise a cloud sandbox or a model.</p><h3>The database cursor still does not describe the browser</h3><p>A committed event can be missing from a browser. The backend might commit event 9 and lose the connection before delivering it. The browser must resume from its own last applied event, not from the backend’s ingestion cursor.</p><p>A page reload adds another case. If the browser keeps a cursor but loses the rows behind it, resuming from that cursor produces an incomplete timeline. Restore the projection and its cursor together, or rebuild the projection from history.</p><p>There is also a serialization detail in the example: IDs are positive decimal strings, including values above JavaScript’s safe-integer range. Python compares them as integers. A JavaScript client should keep them as strings in JSON and use BigInt for numeric comparisons. Alphabetical order is not numeric order, and a gap between IDs is not automatically a missing event.</p><p>The <a href="https://github.com/NexusFox88/hexagon-docs/blob/main/resources/examples/documentation/event-checkpoint.py">complete SQLite example</a> is part of Hexagon, which I maintain. It is an application-side storage example, not a production ingestion service: authorization, storage access, and consumer coordination still belong in the application. The narrow question it answers is testable without any of that infrastructure: when the checkpoint write fails, did the event write roll back too?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ad1f2e3afa8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test an agent progress UI without a model or cloud account]]></title>
            <link>https://medium.com/@mikhail4ai/test-an-agent-progress-ui-without-a-model-or-cloud-account-19c67613926d?source=rss-7cc2b4cfb16b------2</link>
            <guid isPermaLink="false">https://medium.com/p/19c67613926d</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Mikhail4AI]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 05:33:44 GMT</pubDate>
            <atom:updated>2026-11-21T10:43:08.768Z</atom:updated>
            <content:encoded><![CDATA[<p>A browser has eight progress events on screen. Its connection drops. Four more events arrive at the backend wh ile the tab is disconnected.</p><p>What should happen when the tab comes back?</p><p>In the small example below, the same timeline grows from eight rows to twelve. There is no second task submission. The connection indicator changes, but the displayed Run state stays where it was until the client queries that Run again.</p><p>That is the behavior to get right before involving a model. You can reproduce it with Node.js, a browser, and three source files. There is no package install, model key, or cloud account involved.</p><p>You can also <a href="https://hexagon.autos/try/event-replay/">try the browser simulation</a> before downloading anything. It demonstrates the two timelines in memory; the local version below exercises an actual SSE connection.</p><h3>Run the example</h3><p>Clone the documentation repository, then start the standalone server. Use Node.js 24, the version used for this check.</p><pre>git clone https://github.com/NexusFox88/hexagon-docs.git<br>cd hexagon-docs<br>node resources/examples/documentation/event-delivery-server.mjs</pre><p>Open the loopback URL printed by the command. It uses an available port, so copy the address from your terminal rather than assuming port 3000.</p><p>The server produces twelve synthetic events, one every two seconds. The browser connects over actual Server-Sent Events. The source is deliberately small: <a href="https://github.com/NexusFox88/hexagon-docs/blob/main/resources/examples/documentation/event-delivery-server.mjs">server</a>, <a href="https://github.com/NexusFox88/hexagon-docs/blob/main/resources/examples/documentation/event-delivery-viewer.html">viewer</a>, and <a href="https://github.com/NexusFox88/hexagon-docs/blob/main/resources/examples/documentation/event-delivery.mjs">delivery helper</a>.</p><p>Click <strong>Disconnect</strong> before all twelve rows have arrived. Wait a few seconds, then click <strong>Connect</strong>. Missing rows should appear without duplicating the earlier ones. Click <strong>Query Run</strong> to refresh the displayed execution state. Reload the page and the timeline rebuilds from the beginning.</p><p>In the browser check for this article, disconnecting left eight rows and a displayed state of running. Reconnecting produced twelve distinct event IDs. Querying the Run then changed its displayed state to completed. The Run ID stayed synthetic-delivery-run throughout.</p><p>This exercises browser delivery against a synthetic source. It does not run an agent, authenticate a user, or prove cloud recovery. Stop the server with Ctrl-C.</p><h3>The backend cursor is not the browser cursor</h3><p>A backend can save event 9, advance its ingestion cursor, and crash before sending event 9 to the browser. Resuming the browser from that backend cursor would skip an event the user never received.</p><p>Keep two positions: the last event committed to your application’s storage, and the last event applied by this viewer. Reconnect the viewer from its own position and read from the stored timeline. A second tab has its own position even if both tabs share one backend collector.</p><p>The example’s forwardStoredEvents helper uses one ordered read loop for both history and later events. An empty read waits and tries again. It does not switch from a history query to an unrelated live subscription, where an event could fall into the gap between the two.</p><p>The adapter still matters. In a real application, readAfter must return committed rows for the authorized Run, in numeric event-ID order, strictly after the supplied cursor. The demo reconstructs synthetic history in memory; it is not that production adapter.</p><h3>Keep event IDs out of JavaScript Numbers</h3><p>The first example ID is 9007199254740993, beyond JavaScript&#39;s safe-integer range. Converting it to a Number loses precision. Use strings for storage and JSON, and BigInt for comparisons:</p><pre>const isLater = BigInt(event.id) &gt; BigInt(savedCursor);</pre><p>Do not sort the strings alphabetically or require adjacent IDs to differ by one. The documented Hexagon event sequence can have gaps. Deduplicate with the Run ID and event ID together.</p><p>The viewer uses an in-memory map. A transient disconnect can retain that map and its cursor. A page reload loses both, so this example starts at 0. Persisting only the cursor would tell a fresh, empty timeline to skip its own history.</p><h3>Check the failure cases without paying for model calls</h3><p>The accompanying checks deliberately drop a delivery, replay it, send a duplicate, and introduce another committed event after an empty read:</p><pre>node resources/examples/documentation/check-event-delivery.mjs<br>python3 -B resources/examples/documentation/event-checkpoint.py</pre><p>The Node check covers the delivery helper. The Python example separately checks SQLite persistence across restart, replay, and transaction rollback. Both passed for this article. Neither is a cloud or model test.</p><p>Before using this pattern in your application, add viewer authorization, durable storage, backpressure, and bounded reconnect behavior. Render event content as text. Keep the connection indicator separate from execution state, and query the original Run for the final result. The <a href="https://docs.hexagon.autos/en/build/stream-events">streaming guide</a> describes those integration boundaries; the <a href="https://hexagon.autos/blog/recover-agent-stream-disconnects/">recovery guide</a> covers lost submissions and uncertain external writes, which need different handling.</p><p>If you try this in an existing product, <a href="https://github.com/NexusFox88/Hexagon/issues/1">leave the part that did not fit</a>: your backend stack, what the user was doing when the connection dropped, or the command that failed. A small reproduction is more useful than a feature wish list. Hexagon is still a developer preview, and these are the integration details worth finding early.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19c67613926d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A running local console is not a successful cloud-agent installation]]></title>
            <link>https://medium.com/@mikhail4ai/a-running-local-console-is-not-a-successful-cloud-agent-installation-1a6777cb9545?source=rss-7cc2b4cfb16b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a6777cb9545</guid>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Mikhail4AI]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 03:58:23 GMT</pubDate>
            <atom:updated>2026-11-21T10:43:13.454Z</atom:updated>
            <content:encoded><![CDATA[<p>This article documents a fresh-checkout installation audit of Hexagon. Hexagon is a developer preview. The a udit described here did not complete a cloud Run.</p><p>A setup guide can successfully start its web interface and still leave its first meaningful task blocked. Our November 21 installation audit of Hexagon illustrates three independent checks: the language environment, the local control plane, and the path from a cloud sandbox back to that control plane.</p><h3>Check the interpreter before creating the environment</h3><p>The machine had Python 3.9.13 behind python3. Creating a virtual environment succeeded, but installing the Python SDK failed because it requires Python 3.10 or newer. A successful environment creation was not evidence that the SDK could be installed.</p><p>The revised instructions check the interpreter before creating that environment:</p><pre>python3 -c &#39;import sys; assert sys.version_info &gt;= (3, 10), &quot;Python 3.10 or newer is required&quot;; print(sys.version)&#39;</pre><p>An explicitly selected Python 3.13 interpreter then installed the SDK successfully. On another machine, select an installed interpreter meeting the supported version requirement. Use that same interpreter for the version check and environment creation. Installing a newer interpreter does not upgrade an already-created virtual environment.</p><h3>Validate local state without borrowing a working setup</h3><p>The audit cloned public product revision e64574111fabee1e3bfa2f7c08eb403d6fda1c34, installed its Node dependencies and built the TypeScript SDK. Both Python and TypeScript SDK imports succeeded.</p><p>A separate local data directory, database and port set isolated the control-plane lifecycle check. Start, status, restart and stop completed successfully. The Console returned HTTP 200 with HTML. Identity and encryption-key files retained their hashes across restart. The temporary database was removed after shutdown.</p><p>These checks establish useful facts about local installation and persistence. An HTTP response alone does not establish that all Console interactions work, and a management-only control plane does not establish cloud execution.</p><h3>Test the cloud dependency separately</h3><p>The public Python first-session example was then attempted against the existing configured local control plane. Session creation returned credential_proxy_tunnel_unavailable with HTTP 503. A bounded direct tunnel diagnostic identified HTTP 429 from the Cloudflare Quick Tunnel service.</p><p>The control plane is a client of the cloud Sandbox provider and Sandbox Runtime. Model requests travel in the other direction: Sandbox Harness → dedicated credential listener → configured model endpoint. In the audited implementation, the original model key stays in the control plane. Vercel native Header transforms inject a scoped proxy grant, not the original model key; the guest receives a placeholder. Native direct-to-model access is not implemented. Session creation checks credential readiness before inserting a Session, and the Worker checks again before provisioning. Valid connection records do not establish Sandbox-to-listener reachability. Repeating the installation or creating new submission identities would not repair a provider-side rate limit.</p><p>The audit stopped the temporary ingress retry loop, retained the journal and left the saved deployment mode unchanged. A later SDK operation can attempt ingress again. Recovery requires provider availability or a properly configured supported stable ingress path, followed by another real cloud test. This article does not claim that recovery has happened.</p><h3>Report the boundary of the evidence</h3><p>The useful result is not a single “installation passed” badge. It is a set of separately established facts:</p><ul><li>Dependency installation and SDK imports: passed using the supported Python interpreter.</li><li>Isolated local lifecycle and identity retention: passed.</li><li>Console HTTP delivery: passed; full browser interaction was not established by that check.</li><li>Python cloud first-session attempt: failed at credential ingress readiness.</li><li>TypeScript cloud first-session attempt: not run against the same known unavailable ingress.</li></ul><p>A first-use guide should expose these boundaries before a developer mistakes a working local interface for a working cloud agent. Preserve operation identifiers when outcomes are uncertain, reconcile resources before retrying, and mark a real cloud journey complete only after its task, result retrieval and cleanup are observed.</p><p>The project’s <a href="https://docs.hexagon.autos/en/start/install">installation guide</a>, <a href="https://docs.hexagon.autos/en/operate/networking">networking guide</a> and <a href="https://docs.hexagon.autos/en/start/first-session">first-session guide</a> describe the relevant paths. The audit-driven installation and networking documentation fixes are now published in English and Chinese.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a6777cb9545" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Benchmarked 9 Agent Sandboxes. “2 vCPU” Was Off by 3.2×]]></title>
            <link>https://medium.com/@mikhail4ai/i-benchmarked-9-agent-sandboxes-2-vcpu-was-off-by-3-2-2221f0b20099?source=rss-7cc2b4cfb16b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2221f0b20099</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-agent-infrastructure]]></category>
            <category><![CDATA[sandbox]]></category>
            <dc:creator><![CDATA[Mikhail4AI]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 02:08:52 GMT</pubDate>
            <atom:updated>2026-11-21T10:43:20.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_viHzahYfZrcXclWA6HPw.png" /></figure><p>Every few weeks someone posts a comparison of sandbox providers for AI agents. It’s usually a table: provider, $/ vCPU-hour, $/GB-hour, maybe a cold start number pulled from the vendor’s own blog. Sort by price, crown a winner, done.</p><p>I never trusted those tables. An agent’s sandbox spends most of its life waiting for the model to finish thinking. If one provider bills wall-clock time and another bills only the CPU you actually burn, the hourly rate can’t be the whole story. That was my hypothesis, and I was fairly sure of it.</p><p>So I stopped arguing about it and ran the same workload on nine providers.</p><h3>What I ran</h3><p>The providers: E2B, Daytona, Blaxel, Freestyle, Fly.io Sprites, Vercel Sandbox, Upstash Box, Boat and Agent37. I also tried Modal and ix.dev. Modal’s account hit a spend limit before a single image built, and I never finished signing up for ix.dev, so neither is in the numbers.</p><p>Everything ran on October 5, 2026 from one set of scripts. Where a provider let me, I asked for 2 vCPU and 4 GB. Freestyle’s free tier won’t go below 4 vCPU / 8 GB, so it ran bigger, and I note that wherever it matters.</p><p>Four tests:</p><ol><li>Cold start plus rebuild. Create a sandbox from nothing, install git and Node if they’re missing, clone Express, run npm install, require it. Three runs each.</li><li>Idle sweep. Sixty-second sessions at 0%, 50% and 90% idle, three each. “Idle” means the sandbox sits there with no command running, the way it does while an agent waits on an LLM response.</li><li>Pause. Plant a file in /tmp, a file in $HOME, and a background process. Pause for 30 minutes, and separately for 2 hours. Resume and check what survived.</li><li>Fixed CPU job. The same hashing job on every provider, both vCPUs busy, eight runs each.</li></ol><p>The whole thing cost less than a dollar at list price, and all of it fit inside free tiers and trial credits.</p><p>One more thing up front: the dollar figures below are measured lifecycle times multiplied by each provider’s published prices, which I saved the same day. They aren’t invoices. I’m reconciling them against each dashboard before anyone should treat them as gospel.</p><h3>Where I was wrong</h3><p>Here’s the cost of 1,000 sixty-second sessions, at list price:</p><pre>0% idle   50% idle   90% idle   95% idle<br>Agent37              $0.22      $0.22      $0.22      $0.22<br>Boat                 $0.31      $0.31      $0.31      $0.31<br>Sprites*             $1.71      $1.07      $0.56      $0.49<br>E2B                  $2.81      $2.81      $2.81      $2.81<br>Blaxel               $2.83      $2.83      $2.83      $2.83<br>Daytona              $2.84      $2.84      $2.84      $2.84<br>Upstash              $3.33      $1.67      $0.33      $0.17<br>Freestyle (4c/8g)    $4.44      $4.44      $4.44      $4.44<br>Vercel               $5.71      $3.58      $1.87      $1.66</pre><p>btw: Sprites bills RAM by usage; I assumed 1 GB resident.</p><p>Agent37 lists at $0.0065 an hour for that shape. Boat lists at $0.018. Most of the others sit between $0.10 and $0.30. When the gap is ten or twenty times, it doesn’t matter how clever the billing model is. Agent37 and Boat were the cheapest at almost every idle ratio I tried. Only at 95% idle did Upstash slip past them.</p><p>So, “list price doesn’t matter” is wrong. I’m happy to say so.</p><h3>Where I was right</h3><p>Now look at the middle of the table, where the prices are close.</p><p>Upstash charges only for CPU you actually use and doesn’t charge for memory. When the sandbox is busy the whole time, it’s seventh out of nine. When the agent spends 95% of its time waiting on the model, it’s first. Vercel charges for active CPU but bills memory by the wall clock, and it climbs from ninth to fifth. E2B, Daytona and Blaxel bill the reserved size by the second, so their line doesn’t move at all.</p><p>If someone asks me which of those is cheapest, the honest answer is a question back: how much of the time is your agent idle? Without that number, the ranking is a coin flip.</p><h3>A “vCPU” is not a unit</h3><p>This is the part that surprised me most. Same job, two parallel streams, both vCPUs pegged, eight runs each, median time:</p><pre>Boat        1.9 s<br>Blaxel      2.7 s<br>Daytona     3.0 s<br>E2B         3.1 s<br>Freestyle   3.4 s<br>Sprites     3.6 s<br>Vercel      4.4 s<br>Upstash     4.9 s<br>Agent37     6.0 s</pre><p>Every one of those is sold as “2 vCPU” (Freestyle had 4, but the job only uses two). The slowest took 3.2 times as long as the fastest.</p><p>That changes how Agent37’s low price reads. Its default instances run on shared cores, and on this job it came last. If you price the work instead of the hour, Agent37 and Boat land in about the same place: roughly a cent per thousand runs of this job. Agent37 is cheap because it’s slower. That’s a perfectly reasonable trade for some workloads. It’s just not visible in a $/vCPU-hr column.</p><p>Boat was the fastest and the second cheapest, which I did not expect. Boat says it runs on dedicated Ryzen 9 9950X machines, and the numbers are consistent with that.</p><p>Two other things showed up in the reruns. Sprites came in about 20% faster on the second round than the first, which looks like different hosts. E2B moved by about 12%. Daytona barely moved at all, around 1% spread across eight runs. If you benchmark once, you might be measuring which machine you happened to land on.</p><h3>“Pause” means four different things</h3><p>Every provider on the list says it supports pause. Here’s what was left after two hours:</p><pre>Kept memory and running processes<br>  E2B          (frozen)                resume 0.8 s<br>  Freestyle    (frozen)                resume 1.2 s<br>  Blaxel       (auto-standby)          resume 1.4 s<br>  Sprites      (auto-sleep)            first command ~1.3 s</pre><pre>Kept files, killed processes<br>  Daytona      (container mode)    resume 1.5 s<br>  Upstash                          resume 1.9 s<br>  Vercel                           resume 2.5 s<br>  Agent37                          resume 19.4 s</pre><pre>Kept $HOME, killed processes, wiped /tmp<br>  Boat                                 resume 3.5 s</pre><p>Those are four different behaviors behind one word. Some providers freeze the machine. Some put it to sleep on their own once it’s been idle. The rest shut it down and boot it again later from disk, and one of those clears /tmp on the way back up.</p><p>If your agent keeps a dev server running in the background, or drops intermediate files in /tmp, that difference decides whether resuming is instant or a mess. None of it shows up in the pricing table.</p><p>A few details on that list. Blaxel and Sprites don’t have a pause button. They decide for themselves when you’ve been idle long enough. Blaxel took about 35 seconds to reach standby in my runs, against the roughly 15 seconds I’d read about. Sprites took about ten minutes. My first test of Sprites waited 150 seconds, saw it never slept, and nearly made me write that it doesn’t sleep at all. It does. I just hadn’t waited long enough.</p><h3>For stateful agents, you’re buying time</h3><p>This is the result I keep coming back to.</p><p>Scenario: an agent works for 10 minutes, sits idle for 2 hours, then works for another 10. You can keep the sandbox running through the gap, pause it, or delete it and rebuild from scratch when the work comes back.</p><p>Keeping it running is the expensive option nearly everywhere, as you’d expect. The exception is Upstash, which doesn’t bill idle time in the first place. But on almost every provider, pausing and rebuilding came out within a few cents of each other. On E2B and Daytona, both came to about $0.06 a session.</p><p>The difference is how long you wait before you can carry on:</p><pre>resume after 2 h    rebuild (create + reinstall)<br>E2B                0.8 s                 13.2 s<br>Blaxel             1.4 s                 16.1 s<br>Daytona            1.5 s                 42.5 s<br>Vercel             2.5 s                 13.3 s</pre><p>For a long-running agent, the compute bill turns out to be a rounding error. What you’re actually choosing is whether your agent can pick up where it left off in a second, or sit there for 40 seconds reinstalling dependencies. A $/vCPU-hr table can’t show you that.</p><h3>Things the pricing pages don’t mention</h3><p>A handful of things I only found by running the code:</p><ul><li>Vercel’s Hobby plan started rejecting new sandboxes with 429 Concurrency limit exceeded (10) after about ten back-to-back create-and-delete cycles. The account had zero live sandboxes at the time. Deleted sandboxes seem to hold their slot for a while. A bursty workload simply doesn&#39;t run on that plan.</li><li>Sprites: I asked for 2 vCPU and 4 GB and the guest reported 8 and 8. The size you set is a ceiling, not a reservation, and it bills on what you actually use.</li><li>E2B’s default template has 512 MB of memory. Getting 4 GB means building your own template.</li><li>Freestyle: the same API key returned 401 Invalid API key through the older freestyle-sandboxes SDK and worked fine through the current freestyle package. If you benchmarked it with old code, you&#39;d conclude it was broken.</li><li>Containers lie about their size. Inside Upstash and Daytona’s container sandboxes, nproc reported 64 cores, which is the host. The real limit lives in the cgroup. Anyone who reads nproc and writes it into a comparison table is reporting the wrong machine.</li><li>Daytona’s memory-preserving VM mode wasn’t available on my account in either the US or EU region, so it ran in container mode, which only keeps files.</li></ul><h3>So how should you pick?</h3><p>I don’t think there’s a single winner here, and I’m suspicious of anyone who says there is. I’d start from the shape of the work instead:</p><ul><li>Lots of short jobs and you don’t mind them being slow? Absolute price wins. Agent37 and Boat.</li><li>Lots of short jobs and speed matters? Look at price times measured speed. On my numbers that’s Boat.</li><li>Agent mostly waiting on the model, comparing within the usual price range? Billing basis matters. Active-CPU billing (Upstash) pulls ahead as idle time grows.</li><li>Long-running agent with background processes? Ask what pause actually preserves, then how fast it comes back. E2B, Blaxel, Freestyle and Sprites kept processes alive in my tests.</li><li>Only need files to survive? Most providers resume in 1.5 to 3.5 seconds. Agent37 took 19.</li></ul><p><em>If you’ve run something similar and got different numbers, I’d genuinely like to see them.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2221f0b20099" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>