context
59
ctx:discord/blah/tpmjs/59Source document
full texttpmjs-59
text/plain2 KB
doc:agent/tpmjs-59/284e7f68-2ac2-4704-a4e4-de72c1d00b06[2026-02-14 20:40] omega [bot]: **4. Turn 3 — Verification** Sends: *"Read the file omega/sandbox-test.txt and show me the last 3 git log entries"* Uses `readFile` and `shellExec` (git log). The test asserts the response contains "Hello from TPMJS sandbox" — proving the file was written, committed, and can be read back across turns. [2026-02-14 20:40] omega [bot]: **5. Conversation History Check** Second test case GETs the conversation back from the API and verifies: - 3 user messages (one per turn) - 3+ assistant messages - Multiple tool messages (from shellExec, writeFile, readFile, listFiles calls) This confirms the full message chain is persisted correctly in the DB. [2026-02-14 20:40] omega [bot]: **Run it with:** ``` INTEGRATION_TESTS=true pnpm --filter=@tpmjs/web vitest run --config vitest.integration.config.mjs src/test/integration/sandbox/ ``` Requires `AGENT_SANDBOX_URL` pointing to a running sandbox, and the sandbox-shell tools registered in a collection. Skips gracefully if the collection or env isn't set up yet. File: `apps/web/src/test/integration/sandbox/sandbox-shell-e2e.integration.test.ts` [2026-02-14 21:34] omega [bot]: 🛡️ **Sandbox Shell Tools — Robustness Fixes Complete** Implemented 7 robustness fixes across the sandbox system: **1. Session Leak Logging** (conversation route) - Hoisted sandbox URL to outer scope for error visibility - Warns on stream errors with active sandbox sessions **2. Retry Logic** (executor) - Exponential backoff (1s base, 2 retries) on `createSandboxSession` and `executeWithSandbox` - Retries on timeouts, 429, 502, 503, ECONNREFUSED, ECONNRESET **3. Orphaned Session Cleanup** (sandbox server) - On startup, scans session dir and removes leftover dirs from previous runs **4. Disk Quota Enforcement** (sandbox server) - Checks workspace size via `du -sk` before each tool execution - Returns HTTP 413 when quota exceeded **5. Metrics Endpoint** (sandbox server) - New `/metrics` endpoint: uptime, session counts, execution stats, memory, cache - Counters wired into session create/destroy and tool execution **6. Symlink Escape + OOM + Zombie Fixes** (shell tools) - `readFile` verifies `Deno.realPath()` stays in workspace - `listFiles` skips symlinks pointing outside workspace - `collectStream` caps at 200KB to prevent OOM - Timeout uses SIGTERM → SIGKILL (2s grace) for cleaner process cleanup **7. Health Check & Capacity Handling** (executor) - 429/502/503 responses trigger automatic retry with backoff - Network errors (ECONNREFUSED, ECONNRESET) also retry
Facts in this context
Grouped by subject. Each subject links to its full article.
Fix 213 factsex:fix-2
| appliesToFunction | Create Sandbox Session |
| appliesToFunction | Execute With Sandbox |
| location | Executor |
| partOf | Robustness Fixes |
| rdfs:label | Retry Logic |
| rdf:type | Fix |
| retriesOnCondition | Timeout |
| retriesOnErrorCode | ECONNRESET |
| retriesOnErrorCode | ECONNREFUSED |
| retriesOnStatusCode | 429 |
| retriesOnStatusCode | 502 |
| retriesOnStatusCode | 503 |
| usesStrategy | Exponential Backoff |