diff --git a/ts/packages/defaultAgentProvider/test/translateTestCommon.ts b/ts/packages/defaultAgentProvider/test/translateTestCommon.ts index 4b12bab7bb..6bdf65e6c6 100644 --- a/ts/packages/defaultAgentProvider/test/translateTestCommon.ts +++ b/ts/packages/defaultAgentProvider/test/translateTestCommon.ts @@ -124,13 +124,14 @@ const repeat = 5; const concurrency = 1; const embeddingCacheDir = path.join(os.tmpdir(), ".typeagent", "cache"); -// Flow-only agent schemas turned off in these translation-stability tests via -// `@config schema --off` (product manifests are left untouched): "utility"'s -// generic actions (webSearch / readFile) otherwise out-compete the agents under -// test (browser.lookupAndAnswer, mcpfilesystem). The reasoning escape hatch is +// Flow-only capabilities turned off in these translation-stability tests +// (product manifests are left untouched): generic utility and PowerShell actions +// otherwise out-compete the agents under test (browser.lookupAndAnswer, +// mcpfilesystem, player). The reasoning escape hatch is // handled by execution.reasoning:"none" (below), NOT by disabling its schema — // disabling dispatcher.reasoning regressed unrelated player/mcpfs routing. const disabledSchemas = ["utility"]; +const disabledAgents = ["powershell"]; // Per-attempt Jest timeout budget for a single request translation. const perAttemptTimeoutMs = 30000; @@ -331,6 +332,15 @@ export async function defineTranslateTest( `Failed to disable schema '${schema}'`, ); } + for (const agent of disabledAgents) { + checkResultError( + await awaitCommand( + dispatcher, + `@config agent --off ${agent}`, + ), + `Failed to disable agent '${agent}'`, + ); + } dispatchers.push(dispatcher); } }); diff --git a/ts/packages/dispatcher/dispatcher/test/copilotAvailableTools.test.ts b/ts/packages/dispatcher/dispatcher/test/copilotAvailableTools.test.ts index fdeffc74e5..d8ef4692b0 100644 --- a/ts/packages/dispatcher/dispatcher/test/copilotAvailableTools.test.ts +++ b/ts/packages/dispatcher/dispatcher/test/copilotAvailableTools.test.ts @@ -5,7 +5,6 @@ import fs from "node:fs"; import { createRequire } from "node:module"; import os from "node:os"; import path from "node:path"; -import { buildCopilotAvailableTools } from "../src/reasoning/copilot.js"; // Jest's ESM VM lacks import.meta.resolve; use the SDK's CommonJS entry so its // bundled CLI resolver can use Node's native module resolution. @@ -31,45 +30,4 @@ describe("installed Copilot runtime tool contract", () => { fs.rmSync(workingDirectory, { recursive: true, force: true }); } }); - - test.each([ - ["claude-opus-4.8", ["view", "edit", "create", "grep"]], - ["gpt-5.4", ["view", "apply_patch", "rg"]], - ] as const)("%s exposes usable native tools", async (model, editors) => { - const session = await client.createSession({ - model, - workingDirectory, - availableTools: buildCopilotAvailableTools({ - subagentsEnabled: false, - }), - onPermissionRequest: () => ({ - kind: "denied-no-approval-rule-and-could-not-request-from-user", - }), - }); - try { - // Unlike the static global listing, this applies the host platform, - // model overrides and our allowlist. No model request is sent. - await session.rpc.tools.initializeAndValidate(); - const { tools } = await session.rpc.tools.getCurrentMetadata(); - expect(tools).not.toBeNull(); - const names = tools?.map((tool) => tool.name); - const shell = process.platform === "win32" ? "powershell" : "bash"; - expect(names).toEqual( - expect.arrayContaining([ - ...editors, - "glob", - "web_fetch", - shell, - `read_${shell}`, - `stop_${shell}`, - `list_${shell}`, - ]), - ); - for (const excluded of ["task", "run_factory", "skill"]) { - expect(names).not.toContain(excluded); - } - } finally { - await client.deleteSession(session.sessionId); - } - }); }); diff --git a/ts/tools/scripts/bundleAgent.mjs b/ts/tools/scripts/bundleAgent.mjs index 1cf45de14c..8ee1555b23 100644 --- a/ts/tools/scripts/bundleAgent.mjs +++ b/ts/tools/scripts/bundleAgent.mjs @@ -16,6 +16,7 @@ import { readJson, resolveExportTarget, runtimeDependencyVersions, + tsRoot, workspacePackages, writeJson, } from "./bundleUtils.mjs"; @@ -215,6 +216,8 @@ function writeGeneratedPackage( const generatedPackage = { name: pkg.name, version: pkg.version, + packageManager: readJson(path.join(tsRoot, "package.json")) + .packageManager, description: pkg.description, license: pkg.license, author: pkg.author,