diff --git a/package.json b/package.json index f625370..f46867e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tangle-network/braid", - "version": "0.2.0", + "version": "0.2.1", "description": "A universal terminal interface for portable agent profiles", "type": "module", "bin": { @@ -100,11 +100,11 @@ "@dataiku/uv": "0.12.0", "@earendil-works/pi-tui": "0.84.2", "@napi-rs/keyring": "1.3.0", - "@tangle-network/agent-eval": "0.149.0", - "@tangle-network/agent-interface": "1.3.0", - "@tangle-network/agent-provider-cli-bridge": "0.9.4", - "@tangle-network/agent-provider-tangle": "0.13.0", - "@tangle-network/agent-runtime": "0.143.0", + "@tangle-network/agent-eval": "0.163.2", + "@tangle-network/agent-interface": "1.4.0", + "@tangle-network/agent-provider-cli-bridge": "0.9.5", + "@tangle-network/agent-provider-tangle": "0.13.1", + "@tangle-network/agent-runtime": "0.153.2", "@tangle-network/sandbox": "0.31.0", "better-sqlite3-multiple-ciphers": "13.0.3", "chalk": "6.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 67bd30f..4d2798e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,20 +22,20 @@ importers: specifier: 1.3.0 version: 1.3.0 '@tangle-network/agent-eval': - specifier: 0.149.0 - version: 0.149.0 + specifier: 0.163.2 + version: 0.163.2 '@tangle-network/agent-interface': - specifier: 1.3.0 - version: 1.3.0 + specifier: 1.4.0 + version: 1.4.0 '@tangle-network/agent-provider-cli-bridge': - specifier: 0.9.4 - version: 0.9.4 + specifier: 0.9.5 + version: 0.9.5 '@tangle-network/agent-provider-tangle': - specifier: 0.13.0 - version: 0.13.0(@tangle-network/sandbox@0.31.0) + specifier: 0.13.1 + version: 0.13.1(@tangle-network/sandbox@0.31.0) '@tangle-network/agent-runtime': - specifier: 0.143.0 - version: 0.143.0(@tangle-network/agent-eval@0.149.0)(@tangle-network/agent-interface@1.3.0)(@tangle-network/sandbox@0.31.0) + specifier: 0.153.2 + version: 0.153.2(@tangle-network/agent-eval@0.163.2)(@tangle-network/agent-interface@1.4.0)(@tangle-network/sandbox@0.31.0) '@tangle-network/sandbox': specifier: 0.31.0 version: 0.31.0 @@ -512,42 +512,45 @@ packages: '@modelcontextprotocol/sdk': optional: true - '@tangle-network/agent-eval@0.149.0': - resolution: {integrity: sha512-zCU+hhfAhQOPOBCHCErQfFaKTEMdtUWlUR/ZfHqQw6gPPBhHk/+VaFiP4reCca3RfBkUnJtTQyoocqOH+L449w==} + '@tangle-network/agent-eval@0.163.2': + resolution: {integrity: sha512-uKhaHpeSgwiExr9fhU4aHuhK0bb5U7bZEf4uH2ElA+LyJIhXA7suMBPCHWVeIhiun9Nz8hbemOxX60Z1J5W0YQ==} engines: {node: '>=20'} hasBin: true '@tangle-network/agent-interface@1.3.0': resolution: {integrity: sha512-FsuSUkWyEvpGIjp9ENX3yrcXD8G7QhnVIoepknRYaPaaCaDPlHJzF483mBNix1GZ2bTU3aCr2KgHDSUdcjn1kg==} - '@tangle-network/agent-knowledge@8.0.10': - resolution: {integrity: sha512-QOEIXt1t8iCjSNX7do6wqqUoZ8SQYjg5wIgX+Yi4877tnwEHZAQ41g6ibmtoYfPebBFtos2EU4jctJv7oK6T7w==} + '@tangle-network/agent-interface@1.4.0': + resolution: {integrity: sha512-oUN5Ok0DJuNXIwlpi/ZHLeOUQq/LSAAa1Boe4RTt7S4feAWGddya1fTgQogHbnRiHEswFHdw2wvpEb8qyVx49g==} + + '@tangle-network/agent-knowledge@10.7.0': + resolution: {integrity: sha512-zBrDmwAZzvpGm3YzlVXnjrAPgG/bhGsLFl9FXJn2XjwmI4x5ziX9xrHVlHEnG+LCCjAkwu7dn1I+976H+v8/nA==} engines: {node: '>=20.19.0'} hasBin: true peerDependencies: - '@tangle-network/agent-eval': '>=0.149.0 <0.150.0' - '@tangle-network/agent-interface': ^1.1.0 + '@tangle-network/agent-eval': '>=0.163.2 <0.164.0' + '@tangle-network/agent-interface': ^1.4.0 - '@tangle-network/agent-profile-materialize@0.16.0': - resolution: {integrity: sha512-jNBkA91yTYtmdtWxqvGI9wgKsykp9fiRbWmgvlm7Kimi0Fjz7MiAXZnX1RW5yaqLSdPvzKVBOycVXjqk1/dSmQ==} + '@tangle-network/agent-profile-materialize@0.17.1': + resolution: {integrity: sha512-Nk/2PhkHndabvT53Wtrpd19V7btcJiJqvWcsUyRMSZQsjwAXDT/v3ipqhV4ysbyDRidAspadpDbo86enx/eExw==} peerDependencies: '@tangle-network/agent-interface': ^1.0.0 - '@tangle-network/agent-provider-cli-bridge@0.9.4': - resolution: {integrity: sha512-QxpeSO0ZH1wya7z+v5FXw4vQLUHNWiwoelYnBeDFB+tzuFjhyMJRhAb86sleeBLK6ojfKJGNGArVCeQeWcgU3A==} + '@tangle-network/agent-provider-cli-bridge@0.9.5': + resolution: {integrity: sha512-9FrptdbnEelsziDpfaOGlpLE+xS0bw4fgNjzzOHBYBLkZWPRB+TOtGf9iuD4muOIcjnjzWchyKQzoB3P01i+Dg==} - '@tangle-network/agent-provider-tangle@0.13.0': - resolution: {integrity: sha512-SV8/1Op8qYcXKX+P6700UzhsKrW2yq8Py2p5NwoW6rQObBimIkKVPDcMi7fJkGi+/2CTfxGMCbSJPW+pL4d/OA==} + '@tangle-network/agent-provider-tangle@0.13.1': + resolution: {integrity: sha512-DxEZ29SMp/BsjreaD6HM/KroDzinePC65dtLVE0yqdg0KbBT/vkUX8/S7pXsBJTPAxPkjb7rtGCk5uv51pVvzA==} peerDependencies: '@tangle-network/sandbox': '>=0.30.1 <1.0.0' - '@tangle-network/agent-runtime@0.143.0': - resolution: {integrity: sha512-pQcQUh4fPYTD0LfNHU36sK4PV5MGvJY2JT6wv+QXaguHjCA5YNSwgiHFpDwMJUtQTicmZTUHSOXri8tX4BmO6A==} + '@tangle-network/agent-runtime@0.153.2': + resolution: {integrity: sha512-xlRgKLh9r7TnqUd/We7X+O+pQF7wxaR+8Yi7vd90Cf7VQDMLcm0F2gxF3UKUc6IpfnLVPxHj+UdF9cCN2bRVkQ==} engines: {node: '>=22.13.0'} hasBin: true peerDependencies: - '@tangle-network/agent-eval': '>=0.149.0 <0.150.0' - '@tangle-network/agent-interface': ^1.3.0 + '@tangle-network/agent-eval': '>=0.163.2 <0.164.0' + '@tangle-network/agent-interface': ^1.4.0 '@tangle-network/sandbox': '>=0.31.0 <0.32.0' peerDependenciesMeta: '@tangle-network/sandbox': @@ -797,6 +800,7 @@ packages: koffi@3.1.4: resolution: {integrity: sha512-KHX39XIg7afe8ds+0MHPoLiKR9dCzsVK4oAmBUSaeJlcX0xur22f15C2DILbZ6GJ9eyqC+e6Sb1cTG7M17z+Tg==} + deprecated: Unstable Windows builds linear-sum-assignment@1.0.9: resolution: {integrity: sha512-1T2Ek3sxpt2mBHeBFMRJEikiIK/yIOwf+mrxv/DkAU/5ddnCMndZL//hFH7QuHa1tbaQADzsf9t7rkGZKqoFfQ==} @@ -1155,12 +1159,12 @@ snapshots: '@tangle-network/agent-interface': 1.3.0 zod: 4.4.3 - '@tangle-network/agent-eval@0.149.0': + '@tangle-network/agent-eval@0.163.2': dependencies: '@asteasolutions/zod-to-openapi': 9.1.0(zod@4.4.3) '@hono/node-server': 2.1.1(hono@4.13.0) '@tangle-network/agent-core': 0.9.4 - '@tangle-network/agent-interface': 1.3.0 + '@tangle-network/agent-interface': 1.4.0 '@tangle-network/agent-trace-contract': 1.0.2 hono: 4.13.0 linear-sum-assignment: 1.0.9 @@ -1175,35 +1179,41 @@ snapshots: spdx-expression-parse: 5.0.0 zod: 4.4.3 - '@tangle-network/agent-knowledge@8.0.10(@tangle-network/agent-eval@0.149.0)(@tangle-network/agent-interface@1.3.0)': + '@tangle-network/agent-interface@1.4.0': dependencies: - '@tangle-network/agent-eval': 0.149.0 - '@tangle-network/agent-interface': 1.3.0 + '@noble/hashes': 1.8.0 + spdx-expression-parse: 5.0.0 + zod: 4.4.3 + + '@tangle-network/agent-knowledge@10.7.0(@tangle-network/agent-eval@0.163.2)(@tangle-network/agent-interface@1.4.0)': + dependencies: + '@tangle-network/agent-eval': 0.163.2 + '@tangle-network/agent-interface': 1.4.0 '@types/proper-lockfile': 4.1.4 proper-lockfile: 4.1.2 zod: 4.4.3 - '@tangle-network/agent-profile-materialize@0.16.0(@tangle-network/agent-interface@1.3.0)': + '@tangle-network/agent-profile-materialize@0.17.1(@tangle-network/agent-interface@1.4.0)': dependencies: - '@tangle-network/agent-interface': 1.3.0 + '@tangle-network/agent-interface': 1.4.0 - '@tangle-network/agent-provider-cli-bridge@0.9.4': + '@tangle-network/agent-provider-cli-bridge@0.9.5': dependencies: - '@tangle-network/agent-interface': 1.3.0 + '@tangle-network/agent-interface': 1.4.0 undici: 7.29.0 - '@tangle-network/agent-provider-tangle@0.13.0(@tangle-network/sandbox@0.31.0)': + '@tangle-network/agent-provider-tangle@0.13.1(@tangle-network/sandbox@0.31.0)': dependencies: - '@tangle-network/agent-interface': 1.3.0 + '@tangle-network/agent-interface': 1.4.0 '@tangle-network/sandbox': 0.31.0 - '@tangle-network/agent-runtime@0.143.0(@tangle-network/agent-eval@0.149.0)(@tangle-network/agent-interface@1.3.0)(@tangle-network/sandbox@0.31.0)': + '@tangle-network/agent-runtime@0.153.2(@tangle-network/agent-eval@0.163.2)(@tangle-network/agent-interface@1.4.0)(@tangle-network/sandbox@0.31.0)': dependencies: '@tangle-network/agent-core': 0.9.4 - '@tangle-network/agent-eval': 0.149.0 - '@tangle-network/agent-interface': 1.3.0 - '@tangle-network/agent-knowledge': 8.0.10(@tangle-network/agent-eval@0.149.0)(@tangle-network/agent-interface@1.3.0) - '@tangle-network/agent-profile-materialize': 0.16.0(@tangle-network/agent-interface@1.3.0) + '@tangle-network/agent-eval': 0.163.2 + '@tangle-network/agent-interface': 1.4.0 + '@tangle-network/agent-knowledge': 10.7.0(@tangle-network/agent-eval@0.163.2)(@tangle-network/agent-interface@1.4.0) + '@tangle-network/agent-profile-materialize': 0.17.1(@tangle-network/agent-interface@1.4.0) '@tangle-network/agent-trace-contract': 1.0.2 tar-stream: 3.2.0 optionalDependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1bd8c07..8af75be 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -9,13 +9,13 @@ allowBuilds: node-pty: true ignoreScripts: false minimumReleaseAgeExclude: - - '@tangle-network/agent-runtime@0.126.0 || 0.128.0 || 0.131.0 || 0.131.1 || 0.131.2 || 0.131.3 || 0.131.4 || 0.131.5 || 0.131.6 || 0.131.7 || 0.132.0 || 0.132.4 || 0.132.6 || 0.132.9 || 0.132.10 || 0.132.11 || 0.132.12 || 0.133.6 || 0.134.2 || 0.134.4 || 0.134.5 || 0.134.9 || 0.135.0 || 0.135.3 || 0.142.0 || 0.142.1 || 0.142.3 || 0.143.0' - - '@tangle-network/agent-eval@0.143.0 || 0.144.0 || 0.144.1 || 0.144.3 || 0.144.4 || 0.144.6 || 0.144.8 || 0.144.10 || 0.144.11 || 0.144.13 || 0.145.0 || 0.145.1 || 0.145.2 || 0.145.3 || 0.145.9 || 0.145.10 || 0.145.11 || 0.145.14 || 0.145.15 || 0.145.21 || 0.149.0' - - '@tangle-network/agent-interface@0.46.0 || 0.46.1 || 0.47.0 || 0.51.0 || 0.52.0 || 0.53.0 || 0.54.0 || 1.0.0 || 1.1.0 || 1.3.0' - - '@tangle-network/agent-knowledge@7.0.8 || 7.1.2 || 7.1.3 || 7.2.0 || 7.2.2 || 7.2.3 || 7.2.4 || 7.2.6 || 8.0.0 || 8.0.1 || 8.0.5 || 8.0.10' - - '@tangle-network/agent-profile-materialize@0.10.2 || 0.13.1 || 0.14.0 || 0.14.2 || 0.15.1 || 0.15.2' - - '@tangle-network/agent-provider-cli-bridge@0.4.2 || 0.4.3 || 0.5.0 || 0.6.0 || 0.6.4 || 0.7.1 || 0.7.2 || 0.7.3 || 0.7.6 || 0.8.0 || 0.8.1 || 0.9.0 || 0.9.2 || 0.9.3 || 0.9.4' - - '@tangle-network/agent-provider-tangle@0.13.0' + - '@tangle-network/agent-runtime@0.126.0 || 0.128.0 || 0.131.0 || 0.131.1 || 0.131.2 || 0.131.3 || 0.131.4 || 0.131.5 || 0.131.6 || 0.131.7 || 0.132.0 || 0.132.4 || 0.132.6 || 0.132.9 || 0.132.10 || 0.132.11 || 0.132.12 || 0.133.6 || 0.134.2 || 0.134.4 || 0.134.5 || 0.134.9 || 0.135.0 || 0.135.3 || 0.142.0 || 0.142.1 || 0.142.3 || 0.143.0 || 0.153.2' + - '@tangle-network/agent-eval@0.143.0 || 0.144.0 || 0.144.1 || 0.144.3 || 0.144.4 || 0.144.6 || 0.144.8 || 0.144.10 || 0.144.11 || 0.144.13 || 0.145.0 || 0.145.1 || 0.145.2 || 0.145.3 || 0.145.9 || 0.145.10 || 0.145.11 || 0.145.14 || 0.145.15 || 0.145.21 || 0.149.0 || 0.163.2' + - '@tangle-network/agent-interface@0.46.0 || 0.46.1 || 0.47.0 || 0.51.0 || 0.52.0 || 0.53.0 || 0.54.0 || 1.0.0 || 1.1.0 || 1.3.0 || 1.4.0' + - '@tangle-network/agent-knowledge@7.0.8 || 7.1.2 || 7.1.3 || 7.2.0 || 7.2.2 || 7.2.3 || 7.2.4 || 7.2.6 || 8.0.0 || 8.0.1 || 8.0.5 || 8.0.10 || 10.7.0' + - '@tangle-network/agent-profile-materialize@0.10.2 || 0.13.1 || 0.14.0 || 0.14.2 || 0.15.1 || 0.15.2 || 0.17.1' + - '@tangle-network/agent-provider-cli-bridge@0.4.2 || 0.4.3 || 0.5.0 || 0.6.0 || 0.6.4 || 0.7.1 || 0.7.2 || 0.7.3 || 0.7.6 || 0.8.0 || 0.8.1 || 0.9.0 || 0.9.2 || 0.9.3 || 0.9.4 || 0.9.5' + - '@tangle-network/agent-provider-tangle@0.13.0 || 0.13.1' - '@tangle-network/sandbox@0.30.1 || 0.31.0' - hono@4.13.0 - '@esbuild/aix-ppc64@0.28.2' diff --git a/src/eval/execution.ts b/src/eval/execution.ts index 4b800fc..42c4d46 100644 --- a/src/eval/execution.ts +++ b/src/eval/execution.ts @@ -205,9 +205,14 @@ export function evalJudgeProfile(config: EvalRouteConfig): AgentProfile { provider: 'tangle-router', default: config.model, reasoningEffort: 'none', + // One budget bounds the visible answer and the whole completion alike: the judge + // returns a short verdict and must never spend the run on reasoning. Runtime lowers + // these onto the Router route as `max_tokens` and `max_completion_tokens`, which this + // profile used to spell out by hand in `extraBody` and a request-level cap. + maxVisibleOutputTokens: EVAL_TOTAL_COMPLETION_TOKENS, + maxTotalOutputTokens: EVAL_TOTAL_COMPLETION_TOKENS, metadata: { temperature: 0, - maxTokens: EVAL_TOTAL_COMPLETION_TOKENS, retry: { maxAttempts: 3, initialBackoffMs: 1_000, @@ -216,8 +221,6 @@ export function evalJudgeProfile(config: EvalRouteConfig): AgentProfile { requestTimeoutMs: config.timeoutMs, }, extraBody: { - // Router treats this field as the hard ceiling over visible and reasoning tokens. - max_completion_tokens: EVAL_TOTAL_COMPLETION_TOKENS, // GLM enables thinking by default and does not honor reasoning_effort: none. ...(disablesThinking ? { thinking: { type: 'disabled' } } : {}), }, diff --git a/test/eval.test.ts b/test/eval.test.ts index 169babf..dfcbbba 100644 --- a/test/eval.test.ts +++ b/test/eval.test.ts @@ -183,9 +183,10 @@ test('semantic judge execution is one exact AgentProfile owned by Runtime', asyn provider: 'tangle-router', default: DEFAULT_EVAL_MODEL, reasoningEffort: 'none', + maxVisibleOutputTokens: EVAL_TOTAL_COMPLETION_TOKENS, + maxTotalOutputTokens: EVAL_TOTAL_COMPLETION_TOKENS, metadata: { temperature: 0, - maxTokens: EVAL_TOTAL_COMPLETION_TOKENS, retry: { maxAttempts: 3, initialBackoffMs: 1_000, @@ -194,7 +195,6 @@ test('semantic judge execution is one exact AgentProfile owned by Runtime', asyn requestTimeoutMs: 120_000, }, extraBody: { - max_completion_tokens: EVAL_TOTAL_COMPLETION_TOKENS, thinking: { type: 'disabled' }, }, }, @@ -261,9 +261,9 @@ test('semantic judge execution is one exact AgentProfile owned by Runtime', asyn }) const nonGlm = evalJudgeProfile({ ...config, model: 'openai-codex/gpt-5.6-luna' }) - assert.deepEqual(nonGlm.model?.metadata?.extraBody, { - max_completion_tokens: EVAL_TOTAL_COMPLETION_TOKENS, - }) + assert.deepEqual(nonGlm.model?.metadata?.extraBody, {}) + assert.equal(nonGlm.model?.maxVisibleOutputTokens, EVAL_TOTAL_COMPLETION_TOKENS) + assert.equal(nonGlm.model?.maxTotalOutputTokens, EVAL_TOTAL_COMPLETION_TOKENS) }) test('semantic judge retries transient Router failures with the same operation identity', async (context) => { @@ -494,7 +494,7 @@ test('semantic judge refuses an ambiguous smaller request cap before provider sp messages: [{ role: 'user', content: 'candidate' }], maxTokens: 320, }), - /request maxTokens conflicts with AgentProfile model metadata/u, + /request maxTokens 320 conflicts with AgentProfile\.model\.maxVisibleOutputTokens 2048/u, ) assert.equal(calls, 0) }) diff --git a/test/trace-analysis-configuration.test.ts b/test/trace-analysis-configuration.test.ts index e0bf59d..13c3f5b 100644 --- a/test/trace-analysis-configuration.test.ts +++ b/test/trace-analysis-configuration.test.ts @@ -587,7 +587,11 @@ test('runtime-owned trace model call preserves canonical messages, limits, usage content: JSON.stringify({ messages: optimizerRequest().request.messages }), }, ]) - assert.equal(receivedBody?.max_tokens, undefined) + // The request's cap is the visible ceiling, and Runtime now lowers it onto the Router + // route as `max_tokens`; it used to accept the cap and never send it. This profile + // declares no total ceiling, so no `max_completion_tokens` is sent. + assert.equal(receivedBody?.max_tokens, 64) + assert.equal(receivedBody?.max_completion_tokens, undefined) assert.equal(receivedBody?.temperature, 0.2) assert.deepEqual(receivedBody?.response_format, { type: 'json_schema',