fix: outdated tests
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
- Removed the built-in `python` tool in favor of `eval`, so tool allowlists and tool-call handlers referencing `python` need to migrate
|
||||
- Removed the `python.toolMode` setting and replaced mode control with separate `eval.py` and `eval.js` toggles
|
||||
- Changed the tool runtime config surface by migrating `python` execution timeout/export behavior to `eval` and replacing `./ipy/*` internal exports with `./eval/*` paths
|
||||
- Changed the `eval` tool wire format to a single `input` string with `=== CELL ===` sections, fenced language selection, per-cell header timeouts, and `=== RESET ===` directives instead of top-level `cells`, `language`, `timeout`, and `reset` fields
|
||||
- Changed the `eval` tool wire format to a single `input` string composed of markdown fenced code blocks (with per-fence language, timeout, title, and reset metadata in the info string) instead of top-level `cells`, `language`, `timeout`, and `reset` fields
|
||||
|
||||
### Added
|
||||
|
||||
|
||||
@@ -378,7 +378,7 @@ describe("AgentSession python cleanup", () => {
|
||||
expect(EvalTool).toBeDefined();
|
||||
let toolExecutionSettled = false;
|
||||
const toolExecution = EvalTool!
|
||||
.execute("call-id", { input: "=== CELL ===\n```py\nprint('tool')\n```" }, undefined, undefined, undefined)
|
||||
.execute("call-id", { input: "```py\nprint('tool')\n```" }, undefined, undefined, undefined)
|
||||
.finally(() => {
|
||||
toolExecutionSettled = true;
|
||||
});
|
||||
@@ -437,7 +437,7 @@ describe("AgentSession python cleanup", () => {
|
||||
expect(EvalTool).toBeDefined();
|
||||
const toolExecution = EvalTool!.execute(
|
||||
"call-id",
|
||||
{ input: "=== CELL ===\n```py\nprint('tool after warmup')\n```" },
|
||||
{ input: "```py\nprint('tool after warmup')\n```" },
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -493,7 +493,7 @@ describe("AgentSession python cleanup", () => {
|
||||
expect(EvalTool).toBeDefined();
|
||||
let toolExecutionSettled = false;
|
||||
const toolExecution = EvalTool!
|
||||
.execute("call-id", { input: "=== CELL ===\n```py\nprint('tool')\n```" }, undefined, undefined, undefined)
|
||||
.execute("call-id", { input: "```py\nprint('tool')\n```" }, undefined, undefined, undefined)
|
||||
.finally(() => {
|
||||
toolExecutionSettled = true;
|
||||
});
|
||||
@@ -507,14 +507,14 @@ describe("AgentSession python cleanup", () => {
|
||||
|
||||
expect(disposed).toBe(false);
|
||||
expect(toolExecutionSettled).toBe(false);
|
||||
expect(warmupSpy).toHaveBeenCalledTimes(1);
|
||||
expect(warmupSpy).toHaveBeenCalledTimes(2);
|
||||
expect(executeSpy).toHaveBeenCalledTimes(1);
|
||||
|
||||
const [toolResult] = await Promise.all([toolExecution, disposeSession]);
|
||||
|
||||
expect(disposed).toBe(true);
|
||||
expect(toolExecutionSettled).toBe(true);
|
||||
expect(warmupSpy).toHaveBeenCalledTimes(1);
|
||||
expect(warmupSpy).toHaveBeenCalledTimes(2);
|
||||
expect(executeSpy).toHaveBeenCalledTimes(1);
|
||||
expect(toolResult.details?.isError).toBe(true);
|
||||
expect(toolResult.content).toContainEqual(
|
||||
@@ -726,7 +726,7 @@ describe("AgentSession python cleanup", () => {
|
||||
await expect(
|
||||
EvalTool!.execute(
|
||||
"call-id",
|
||||
{ input: "=== CELL ===\n```py\nprint('late')\n```" },
|
||||
{ input: "```py\nprint('late')\n```" },
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -767,7 +767,7 @@ describe("AgentSession python cleanup", () => {
|
||||
expect(EvalTool).toBeDefined();
|
||||
const execution = EvalTool!.execute(
|
||||
"call-id",
|
||||
{ input: "=== CELL ===\n```py\nprint('late after artifact')\n```" },
|
||||
{ input: "```py\nprint('late after artifact')\n```" },
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
|
||||
@@ -40,7 +40,7 @@ const shouldRun = Boolean(pythonPath) && hasKernelDeps;
|
||||
|
||||
describe.skipIf(!shouldRun)("PYTHON_PRELUDE integration", () => {
|
||||
it("exposes prelude helpers via eval python backend", async () => {
|
||||
const helpers = ["env", "read", "write", "append", "rm", "mv", "cp", "find", "grep"];
|
||||
const helpers = ["env", "read", "write", "append", "find", "glob", "grep", "rgrep", "sed", "tree", "stat", "diff", "run", "output"];
|
||||
|
||||
const session = {
|
||||
cwd: getProjectDir(),
|
||||
@@ -64,8 +64,7 @@ describe.skipIf(!shouldRun)("PYTHON_PRELUDE integration", () => {
|
||||
`;
|
||||
|
||||
const result = await tool.execute("tool-call-1", {
|
||||
input: `=== CELL prelude helpers ===
|
||||
\`\`\`py
|
||||
input: `\`\`\`py prelude helpers
|
||||
${code}
|
||||
\`\`\`
|
||||
`,
|
||||
|
||||
@@ -40,7 +40,7 @@ describe("EvalTool language resolution", () => {
|
||||
|
||||
const tool = new EvalTool(makeSession());
|
||||
await tool.execute("call-1", {
|
||||
input: "=== CELL one ===\n```js\nconst x = 1;\n```\n",
|
||||
input: "```js one\nconst x = 1;\n```\n",
|
||||
});
|
||||
|
||||
expect(jsExecuteSpy).toHaveBeenCalledTimes(1);
|
||||
@@ -54,7 +54,7 @@ describe("EvalTool language resolution", () => {
|
||||
|
||||
const tool = new EvalTool(makeSession());
|
||||
await tool.execute("call-2", {
|
||||
input: "=== CELL one ===\n```python\nprint('hi')\n```\n",
|
||||
input: "```python one\nprint('hi')\n```\n",
|
||||
});
|
||||
|
||||
expect(pythonExecuteSpy).toHaveBeenCalledTimes(1);
|
||||
@@ -68,7 +68,7 @@ describe("EvalTool language resolution", () => {
|
||||
|
||||
const tool = new EvalTool(makeSession());
|
||||
await tool.execute("call-3", {
|
||||
input: "=== CELL one ===\ndef greet():\n print('hi')\ngreet()\n",
|
||||
input: "def greet():\n print('hi')\ngreet()\n",
|
||||
});
|
||||
|
||||
expect(pythonExecuteSpy).toHaveBeenCalledTimes(1);
|
||||
|
||||
Reference in New Issue
Block a user