Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions ts/packages/defaultAgentProvider/test/translateTestCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
}
});
});
3 changes: 3 additions & 0 deletions ts/tools/scripts/bundleAgent.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
readJson,
resolveExportTarget,
runtimeDependencyVersions,
tsRoot,
workspacePackages,
writeJson,
} from "./bundleUtils.mjs";
Expand Down Expand Up @@ -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,
Expand Down
Loading