@tangle-network/agent-bench 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.5
|
|
4
|
+
|
|
5
|
+
- Allow the zero-model Pier proof to complete a cold separate-verifier image build before its task and overall execution deadlines.
|
|
6
|
+
- Consume Runtime 0.107.5 with Eval 0.133.3, Interface 0.36.0, Knowledge 6.1.5, and Sandbox 0.15.1.
|
|
7
|
+
|
|
3
8
|
## 0.4.4
|
|
4
9
|
|
|
5
10
|
- Consume Runtime 0.107.2 and Sandbox 0.15.0 with the current Eval, Interface, and Knowledge packages.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-bench",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Benchmark adapters and execution for agent-runtime across coding, tool-use, RAG, memory, browser, and terminal tasks.",
|
|
6
6
|
"repository": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tangle-network/agent-eval": "0.133.
|
|
28
|
+
"@tangle-network/agent-eval": "0.133.3",
|
|
29
29
|
"@tangle-network/agent-interface": "0.36.0",
|
|
30
|
-
"@tangle-network/agent-knowledge": "6.1.
|
|
31
|
-
"@tangle-network/sandbox": "0.15.
|
|
32
|
-
"@tangle-network/agent-runtime": "0.107.
|
|
30
|
+
"@tangle-network/agent-knowledge": "6.1.5",
|
|
31
|
+
"@tangle-network/sandbox": "0.15.1",
|
|
32
|
+
"@tangle-network/agent-runtime": "0.107.5"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@arethetypeswrong/cli": "0.18.5",
|
|
@@ -435,7 +435,7 @@ ${proofArm === 'success' ? "(task / 'src/status.txt').write_text('ready\\nowner=
|
|
|
435
435
|
workspace: taskWorkspace,
|
|
436
436
|
evaluatorTaskContainer: container,
|
|
437
437
|
limits: {
|
|
438
|
-
timeoutMs:
|
|
438
|
+
timeoutMs: 600_000,
|
|
439
439
|
maxSteps: 8,
|
|
440
440
|
maxModelCalls: 0,
|
|
441
441
|
maxInputTokens: 0,
|
|
@@ -3,11 +3,25 @@ import { tmpdir } from 'node:os'
|
|
|
3
3
|
import { join } from 'node:path'
|
|
4
4
|
import { afterAll, describe, expect, it } from 'vitest'
|
|
5
5
|
import { runSupervisorShim, supervisorDriverKillGraceMs } from './arms.ts'
|
|
6
|
-
import {
|
|
6
|
+
import { ABORT_RC, run } from './proc.ts'
|
|
7
7
|
|
|
8
8
|
const dirs: string[] = []
|
|
9
9
|
const workerPids: number[] = []
|
|
10
10
|
|
|
11
|
+
async function waitForFile(path: string, timeoutMs = 10_000): Promise<void> {
|
|
12
|
+
const deadline = Date.now() + timeoutMs
|
|
13
|
+
while (Date.now() < deadline) {
|
|
14
|
+
try {
|
|
15
|
+
await access(path)
|
|
16
|
+
return
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error
|
|
19
|
+
}
|
|
20
|
+
await new Promise((resolve) => setTimeout(resolve, 10))
|
|
21
|
+
}
|
|
22
|
+
throw new Error(`timed out waiting for ${path}`)
|
|
23
|
+
}
|
|
24
|
+
|
|
11
25
|
afterAll(async () => {
|
|
12
26
|
for (const pid of workerPids) {
|
|
13
27
|
try {
|
|
@@ -122,6 +136,7 @@ export default function fakeExtension(pi) {
|
|
|
122
136
|
writeFileSync(join(runDir, 'state.json'), JSON.stringify({ status: 'running' }))
|
|
123
137
|
appendFileSync(join(runDir, 'journal.jsonl'), JSON.stringify({ kind: 'spawned', id, label: 'root' }) + '\\n')
|
|
124
138
|
appendFileSync(join(runDir, 'journal.jsonl'), JSON.stringify({ kind: 'spawned', id: id + ':s1', parent: id, label: 'w-0' }) + '\\n')
|
|
139
|
+
writeFileSync(join(ctx.cwd, 'outer-driver-ready.txt'), 'ready')
|
|
125
140
|
return text('spawned supervisor ' + id)
|
|
126
141
|
},
|
|
127
142
|
})
|
|
@@ -140,10 +155,11 @@ export default function fakeExtension(pi) {
|
|
|
140
155
|
`)
|
|
141
156
|
|
|
142
157
|
const cancelTimeoutMs = 1_500
|
|
143
|
-
const
|
|
158
|
+
const controller = new AbortController()
|
|
159
|
+
const resultPromise = run(process.execPath, [
|
|
144
160
|
'--import', 'tsx', runSupervisorShim, extension, workspace, params,
|
|
145
161
|
], {
|
|
146
|
-
|
|
162
|
+
signal: controller.signal,
|
|
147
163
|
killGraceMs: supervisorDriverKillGraceMs({
|
|
148
164
|
DRIVER_CANCEL_TIMEOUT_MS: String(cancelTimeoutMs),
|
|
149
165
|
}),
|
|
@@ -154,9 +170,19 @@ export default function fakeExtension(pi) {
|
|
|
154
170
|
DRIVER_CANCEL_TIMEOUT_MS: String(cancelTimeoutMs),
|
|
155
171
|
},
|
|
156
172
|
})
|
|
173
|
+
try {
|
|
174
|
+
await waitForFile(join(workspace, 'outer-driver-ready.txt'))
|
|
175
|
+
} catch (error) {
|
|
176
|
+
controller.abort()
|
|
177
|
+
await resultPromise
|
|
178
|
+
throw error
|
|
179
|
+
}
|
|
180
|
+
controller.abort()
|
|
181
|
+
const result = await resultPromise
|
|
157
182
|
|
|
158
|
-
expect(result.code, result.stdout + result.stderr).toBe(
|
|
159
|
-
expect(result.
|
|
183
|
+
expect(result.code, result.stdout + result.stderr).toBe(ABORT_RC)
|
|
184
|
+
expect(result.aborted).toBe(true)
|
|
185
|
+
expect(result.timedOut).toBe(false)
|
|
160
186
|
expect(await readFile(join(workspace, 'outer-cancel-settled.txt'), 'utf8')).toBe('settled')
|
|
161
187
|
expect(JSON.parse(await readFile(join(workspace, '.loops', 'supervisor', 'sup-2-fake34', 'state.json'), 'utf8')))
|
|
162
188
|
.toMatchObject({ status: 'cancelled' })
|
|
@@ -170,10 +196,10 @@ export default function fakeExtension(pi) {
|
|
|
170
196
|
const extension = join(dir, 'fake-extension.mjs')
|
|
171
197
|
await mkdir(workspace)
|
|
172
198
|
await writeFile(params, '{}')
|
|
173
|
-
const workerScript = `const fs=require('node:fs'); const marker=process.argv[1]; process.on('SIGTERM',()=>setTimeout(()=>{fs.writeFileSync(marker,'clean'); process.exit(0)},30)); setInterval(()=>{},1000)`
|
|
199
|
+
const workerScript = `const fs=require('node:fs'); const marker=process.argv[1]; const ready=process.argv[2]; process.on('SIGTERM',()=>setTimeout(()=>{fs.writeFileSync(marker,'clean'); process.exit(0)},30)); fs.writeFileSync(ready,'ready'); setInterval(()=>{},1000)`
|
|
174
200
|
await writeFile(extension, `
|
|
175
201
|
import { spawn } from 'node:child_process'
|
|
176
|
-
import { appendFileSync, mkdirSync, writeFileSync } from 'node:fs'
|
|
202
|
+
import { appendFileSync, existsSync, mkdirSync, writeFileSync } from 'node:fs'
|
|
177
203
|
import { join } from 'node:path'
|
|
178
204
|
|
|
179
205
|
const id = 'sup-3-signal56'
|
|
@@ -188,11 +214,13 @@ export default function fakeExtension(pi) {
|
|
|
188
214
|
writeFileSync(join(runDir, 'state.json'), JSON.stringify({ status: 'running' }))
|
|
189
215
|
appendFileSync(join(runDir, 'journal.jsonl'), JSON.stringify({ kind: 'spawned', id, label: 'root' }) + '\\n')
|
|
190
216
|
appendFileSync(join(runDir, 'journal.jsonl'), JSON.stringify({ kind: 'spawned', id: id + ':s1', parent: id, label: 'w-0' }) + '\\n')
|
|
191
|
-
|
|
217
|
+
const readyPath = join(ctx.cwd, 'signal-worker-ready.txt')
|
|
218
|
+
child = spawn(process.execPath, ['-e', ${JSON.stringify(workerScript)}, join(ctx.cwd, 'signal-worker-cleaned.txt'), readyPath], {
|
|
192
219
|
detached: true,
|
|
193
220
|
stdio: 'ignore',
|
|
194
221
|
})
|
|
195
222
|
writeFileSync(join(ctx.cwd, 'signal-worker.pid'), String(child.pid))
|
|
223
|
+
while (!existsSync(readyPath)) await new Promise((resolve) => setTimeout(resolve, 5))
|
|
196
224
|
writeFileSync(join(ctx.cwd, 'spawn-entered.txt'), 'entered')
|
|
197
225
|
await new Promise((resolve) => setTimeout(resolve, 30_000))
|
|
198
226
|
return text('spawned supervisor ' + id)
|
|
@@ -214,10 +242,11 @@ export default function fakeExtension(pi) {
|
|
|
214
242
|
`)
|
|
215
243
|
|
|
216
244
|
const cancelTimeoutMs = 2_000
|
|
217
|
-
const
|
|
245
|
+
const controller = new AbortController()
|
|
246
|
+
const resultPromise = run(process.execPath, [
|
|
218
247
|
'--import', 'tsx', runSupervisorShim, extension, workspace, params,
|
|
219
248
|
], {
|
|
220
|
-
|
|
249
|
+
signal: controller.signal,
|
|
221
250
|
killGraceMs: supervisorDriverKillGraceMs({
|
|
222
251
|
DRIVER_CANCEL_TIMEOUT_MS: String(cancelTimeoutMs),
|
|
223
252
|
}),
|
|
@@ -228,11 +257,21 @@ export default function fakeExtension(pi) {
|
|
|
228
257
|
DRIVER_CANCEL_TIMEOUT_MS: String(cancelTimeoutMs),
|
|
229
258
|
},
|
|
230
259
|
})
|
|
260
|
+
try {
|
|
261
|
+
await waitForFile(join(workspace, 'spawn-entered.txt'))
|
|
262
|
+
} catch (error) {
|
|
263
|
+
controller.abort()
|
|
264
|
+
await resultPromise
|
|
265
|
+
throw error
|
|
266
|
+
}
|
|
267
|
+
controller.abort()
|
|
268
|
+
const result = await resultPromise
|
|
231
269
|
const workerPid = Number(await readFile(join(workspace, 'signal-worker.pid'), 'utf8'))
|
|
232
270
|
workerPids.push(workerPid)
|
|
233
271
|
|
|
234
|
-
expect(result.code, result.stdout + result.stderr).toBe(
|
|
235
|
-
expect(result.
|
|
272
|
+
expect(result.code, result.stdout + result.stderr).toBe(ABORT_RC)
|
|
273
|
+
expect(result.aborted).toBe(true)
|
|
274
|
+
expect(result.timedOut).toBe(false)
|
|
236
275
|
expect(await readFile(join(workspace, 'spawn-entered.txt'), 'utf8')).toBe('entered')
|
|
237
276
|
expect(await readFile(join(workspace, 'signal-worker-cleaned.txt'), 'utf8')).toBe('clean')
|
|
238
277
|
expect(await readFile(join(workspace, 'signal-cancel-settled.txt'), 'utf8')).toBe('settled')
|