|
15 | 15 | * Usage: |
16 | 16 | * node scripts/bench-memory-run.mjs [--port 9223] [--messages 2] |
17 | 17 | * [--label <label>] [--out results.jsonl] [--idle-only] |
| 18 | + * [--scenario thread|switch|longout] |
| 19 | + * [--thread-task-id <id>] [--thread-title <title>] |
18 | 20 | * |
19 | 21 | * Prints a JSON report; final line is `TOTAL_RSS_MB=<post-workflow median>` |
20 | 22 | * (idle median with --idle-only) for predicate extraction via `tail -1`. |
21 | 23 | * |
22 | 24 | * NOTE: workflow turns hit the real agent backend with trivial prompts |
23 | 25 | * ("reply with exactly <token>") to keep token cost minimal while exercising |
24 | 26 | * the real agent-session memory path. |
| 27 | + * |
| 28 | + * IMPORTANT: the `thread` and `longout` scenarios send turns into a dedicated |
| 29 | + * throwaway task so benchmark chatter never lands in real work. The default |
| 30 | + * --thread-task-id/--thread-title point at the original author's local bench |
| 31 | + * task — in any other environment, create a scratch task once and pass its id |
| 32 | + * and title explicitly, or the run aborts with "refusing to send benchmark |
| 33 | + * turns". |
25 | 34 | */ |
26 | 35 |
|
27 | 36 | import { execFileSync, spawn } from "node:child_process"; |
28 | 37 | import { appendFileSync } from "node:fs"; |
29 | 38 | import path from "node:path"; |
30 | 39 | import { fileURLToPath } from "node:url"; |
31 | 40 |
|
32 | | -const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); |
| 41 | +const repoRoot = path.resolve( |
| 42 | + path.dirname(fileURLToPath(import.meta.url)), |
| 43 | + "..", |
| 44 | +); |
33 | 45 |
|
34 | 46 | const args = process.argv.slice(2); |
35 | 47 | function arg(name, fallback) { |
@@ -144,7 +156,8 @@ async function openBenchTask(page) { |
144 | 156 | .catch(() => ""); |
145 | 157 | if (!header?.includes(title)) { |
146 | 158 | throw new Error( |
147 | | - `refusing to send benchmark turns: open task is "${header}", expected "${title}"`, |
| 159 | + `refusing to send benchmark turns: open task is "${header}", expected "${title}". ` + |
| 160 | + `Create a throwaway task in your environment and pass --thread-task-id/--thread-title.`, |
148 | 161 | ); |
149 | 162 | } |
150 | 163 | } |
|
0 commit comments