Skip to content

Commit 305627e

Browse files
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7wpfleger96
andcommitted
fix(scripts): delete ESM loader, fix harness import name, update usage doc
Hayt's pass-2 commit added an explicit './modelCapabilities.ts' extension to buzzAgentConfig.ts, making the custom ESM loader unnecessary. - Delete scripts/ts-esm-loader.mjs — no longer needed. - Remove polyglot shebang from run-differential.mjs; replace with plain #!/usr/bin/env node shebang. - Update usage line to: node --experimental-strip-types scripts/run-differential.mjs - Rename old-side import from getProviderEffortConfig (now the generated-backed production function) to getProviderEffortConfig_oldHandTable (the explicit differential shim exported by buzzAgentConfig.ts for this harness only). - Fix stale comments in llm.rs body-builder tests that described the old normalize_effort_for_openai_route dispatch path (now uses normalize_effort_for_databricks_v2 for DatabricksV2). Differential still passes: 85 checks, 0 unexpected divergences, 6/6 allowlist slots. Co-authored-by: Will Pfleger <[email protected]> Signed-off-by: Will Pfleger <[email protected]>
1 parent 7b019da commit 305627e

3 files changed

Lines changed: 11 additions & 43 deletions

File tree

‎crates/buzz-agent/src/llm.rs‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4226,15 +4226,17 @@ mod tests {
42264226

42274227
// ---- DatabricksV2 route-aware effort normalization (body-level assertions) ----
42284228
//
4229-
// The DBv2 `complete()` dispatch applies `normalize_effort_for_openai_route` /
4230-
// `normalize_effort_for_anthropic_route` before calling body builders. These tests
4231-
// verify the body shape that results from the already-normalized effort values — i.e.,
4232-
// they confirm the body builders correctly serialize the values the dispatch passes them.
4229+
// These tests verify the body shape produced by the body builders when passed
4230+
// a pre-normalized effort value. The effort is pre-normalized here via the old
4231+
// helper (normalize_effort_for_openai_route) to produce the expected clamped value,
4232+
// mirroring what normalize_effort_for_databricks_v2 would return for these models
4233+
// (OpenAiStandard policy → delegates to normalize_effort_for_openai_route).
42334234

42344235
#[test]
42354236
fn dbv2_openai_route_max_effort_clamped_to_xhigh_in_responses_body() {
4236-
// DBv2 GPT-5.5 route: max → clamped to xhigh by normalize_effort_for_openai_route
4237-
// before reaching responses_body. gpt-5.5 supports xhigh so the final value is xhigh.
4237+
// DBv2 GPT-5.5 route: max → clamped to xhigh (OpenAiStandard policy).
4238+
// Pre-normalize via normalize_effort_for_openai_route (same as what
4239+
// normalize_effort_for_databricks_v2 delegates to for OpenAiStandard).
42384240
let clamped =
42394241
crate::config::normalize_effort_for_openai_route(ThinkingEffort::Max, "gpt-5.5");
42404242
let body = responses_body(

‎scripts/run-differential.mjs‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/bin/sh
2-
// 2>/dev/null; LOADER="$(cd "$(dirname "$0")" && pwd)/ts-esm-loader.mjs"; exec node --experimental-strip-types --loader "$LOADER" "$0" "$@"
1+
#!/usr/bin/env node
32
/**
43
* Phase-2 differential harness — compare old buzzAgentConfig.ts effort logic with
54
* the new generated modelCapabilities.ts interpreter over:
@@ -10,14 +9,8 @@
109
* Equality is required except for entries in the committed allowlist of intentional
1110
* F1 corrections (models.dev provider-capability reconciliations).
1211
*
13-
* Usage: node scripts/run-differential.mjs [--verbose]
12+
* Usage: node --experimental-strip-types scripts/run-differential.mjs [--verbose]
1413
* Exits 0 on all-pass (modulo allowlist), 1 on unexpected divergence or unexercised allowlist entry.
15-
*
16-
* NOTE: The shebang bootstraps --experimental-strip-types and a custom ESM loader
17-
* (ts-esm-loader.mjs) that resolves extensionless relative TS imports. This is
18-
* required because buzzAgentConfig.ts (Phase 2b) imports modelCapabilities via a
19-
* bare specifier ("./modelCapabilities") that Node's strip-types runner cannot
20-
* otherwise resolve.
2114
*/
2215

2316
import { readFileSync } from "node:fs";
@@ -38,7 +31,7 @@ const { resolveModelCapabilities: resolveNew } = await import(
3831
);
3932

4033
// OLD: buzzAgentConfig.ts effort config
41-
const { getProviderEffortConfig: getOldEffortConfig } = await import(
34+
const { getProviderEffortConfig_oldHandTable: getOldEffortConfig } = await import(
4235
join(repoRoot, "desktop", "src", "features", "agents", "ui", "buzzAgentConfig.ts")
4336
);
4437

‎scripts/ts-esm-loader.mjs‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)