diff --git a/package-lock.json b/package-lock.json index f0c65da8..9257884a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@agentclientprotocol/sdk": "^1.4.0", - "@openai/codex": "^0.155.0", + "@openai/codex": "^0.155.1", "diff": "^9.0.0", "open": "^11.0.1", "vscode-jsonrpc": "^9.0.1", @@ -901,9 +901,9 @@ } }, "node_modules/@openai/codex": { - "version": "0.155.0", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.0.tgz", - "integrity": "sha512-35a85Hbwy9WXkDTJumLjTcmMgpR7BMdrTloWBVGjoA+FBCh7jb3+cYp2W+3U4klqGAjAskoIvQZv7/eedmCjHA==", + "version": "0.155.1", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.1.tgz", + "integrity": "sha512-02fAAGyBtlA1zPjEo3kTj/bOSYbPz5DvjLwRZJdV7weFFEDzNFOMjQGmZ/+5CuirYV0hE+AZTrnjzwXYU4AdAQ==", "license": "Apache-2.0", "bin": { "codex": "bin/codex.js" @@ -912,19 +912,19 @@ "node": ">=16" }, "optionalDependencies": { - "@openai/codex-darwin-arm64": "npm:@openai/codex@0.155.0-darwin-arm64", - "@openai/codex-darwin-x64": "npm:@openai/codex@0.155.0-darwin-x64", - "@openai/codex-linux-arm64": "npm:@openai/codex@0.155.0-linux-arm64", - "@openai/codex-linux-x64": "npm:@openai/codex@0.155.0-linux-x64", - "@openai/codex-win32-arm64": "npm:@openai/codex@0.155.0-win32-arm64", - "@openai/codex-win32-x64": "npm:@openai/codex@0.155.0-win32-x64" + "@openai/codex-darwin-arm64": "npm:@openai/codex@0.155.1-darwin-arm64", + "@openai/codex-darwin-x64": "npm:@openai/codex@0.155.1-darwin-x64", + "@openai/codex-linux-arm64": "npm:@openai/codex@0.155.1-linux-arm64", + "@openai/codex-linux-x64": "npm:@openai/codex@0.155.1-linux-x64", + "@openai/codex-win32-arm64": "npm:@openai/codex@0.155.1-win32-arm64", + "@openai/codex-win32-x64": "npm:@openai/codex@0.155.1-win32-x64" } }, "node_modules/@openai/codex-darwin-arm64": { "name": "@openai/codex", - "version": "0.155.0-darwin-arm64", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.0-darwin-arm64.tgz", - "integrity": "sha512-c0vbt2ZS6XiXq9gQkNictu7PH0deMyq/bw4Ia9bdihU1iJHuGuwC5vD4swU4xhLUKoTs4tMOHwYWKaofFZcVRg==", + "version": "0.155.1-darwin-arm64", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.1-darwin-arm64.tgz", + "integrity": "sha512-cYxzGcRRoBrncyHlR8ed4yXwcoVJZC1pipGULSyJkGFKXJw/Uu57BklvzayuAptjJIipamnOk32CfUkk1F0bLw==", "cpu": [ "arm64" ], @@ -939,9 +939,9 @@ }, "node_modules/@openai/codex-darwin-x64": { "name": "@openai/codex", - "version": "0.155.0-darwin-x64", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.0-darwin-x64.tgz", - "integrity": "sha512-Epo33vwukf4uPyxg1c7+7+P4J6YgggdwQrCR/BRGuhjpadZAzoAntfm54CPCNHvW6uSq8BHQX/e9G+f5/0XQ7Q==", + "version": "0.155.1-darwin-x64", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.1-darwin-x64.tgz", + "integrity": "sha512-FDpc+PdELYlyDnhd76Ckm6jNLF+1n3x34Ygd4QLQger810Vkxx/InQ5LY5jwkecJYKcbvyhMmuxTspaj1dLZrA==", "cpu": [ "x64" ], @@ -956,9 +956,9 @@ }, "node_modules/@openai/codex-linux-arm64": { "name": "@openai/codex", - "version": "0.155.0-linux-arm64", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.0-linux-arm64.tgz", - "integrity": "sha512-iMyMjIYHlBUUDeTEGeEftQozQz0h7nYYCaLDJlZnqDF2Y0+bfdD/ppDS3vsw6mIz/z49haC6TCer11iEWO6fsA==", + "version": "0.155.1-linux-arm64", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.1-linux-arm64.tgz", + "integrity": "sha512-X3fRXm2orhJ3KeB8LgKym4XDUiQaqaOGuaa181bcHTsQI7C8m6tcQQbQsKDzT/2IibikzgYL82jvsgMbq43jww==", "cpu": [ "arm64" ], @@ -973,9 +973,9 @@ }, "node_modules/@openai/codex-linux-x64": { "name": "@openai/codex", - "version": "0.155.0-linux-x64", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.0-linux-x64.tgz", - "integrity": "sha512-CiXkVTy4ERdFSXXP8n98/iOyVUCOYFPQ8cuwgeOEEbLhe1LnlQbgH/H8ZeuxO9WXKIZLJg0x626UgR9axY2zSA==", + "version": "0.155.1-linux-x64", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.1-linux-x64.tgz", + "integrity": "sha512-atv3HF0mubqB0J/XkQ2JopqKzXJ+/7aQtTB2MkJ9MrraujMIz8zbCCLylLkN3PzpVGTJzzQFN/wD1oq8oJPJKg==", "cpu": [ "x64" ], @@ -990,9 +990,9 @@ }, "node_modules/@openai/codex-win32-arm64": { "name": "@openai/codex", - "version": "0.155.0-win32-arm64", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.0-win32-arm64.tgz", - "integrity": "sha512-aFIONQhKxg+XEVsInLRI2OG8S9OUvfK+nzc4sWcbn8DgxlmuPkbVzloSrD5psh1lKnG4s2qd3QK8tCClSgLzJw==", + "version": "0.155.1-win32-arm64", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.1-win32-arm64.tgz", + "integrity": "sha512-k5x8VO1aF8Xx/nuh1P31TeBgs11WA6i2GJiHqx5YCndFbWzOzUz6aeBaq9+PO6Qfe/Ivennh3I1FKJBU6Q8mpg==", "cpu": [ "arm64" ], @@ -1007,9 +1007,9 @@ }, "node_modules/@openai/codex-win32-x64": { "name": "@openai/codex", - "version": "0.155.0-win32-x64", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.0-win32-x64.tgz", - "integrity": "sha512-yfB9DHAB0YLTy3oD4one21pzGIJ99b+U/PW4htAq6OLccPSZa8OZz5HeN3XVy1a2/BbCqwWmK+w4p/aG/3DCRw==", + "version": "0.155.1-win32-x64", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.155.1-win32-x64.tgz", + "integrity": "sha512-MO+cCZrgU0Ec7lJP/5NsTe5obJ9/qtRMkQUK0jYWTY1omxLA3lp5IOD2IAmsejlEJB931XRo51LZ7hl178CDjA==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 59cacc8f..cf64a9a1 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ }, "dependencies": { "@agentclientprotocol/sdk": "^1.4.0", - "@openai/codex": "^0.155.0", + "@openai/codex": "^0.155.1", "diff": "^9.0.0", "open": "^11.0.1", "vscode-jsonrpc": "^9.0.1", diff --git a/src/__tests__/AgentFileChangeReport.test.ts b/src/__tests__/AgentFileChangeReport.test.ts index 9ac00054..1d710f65 100644 --- a/src/__tests__/AgentFileChangeReport.test.ts +++ b/src/__tests__/AgentFileChangeReport.test.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; -import {describe, expect, it} from "vitest"; +import {describe, expect, it, vi} from "vitest"; import { AGENT_FILE_CHANGE_REPORT_MAX_DIFF_BYTES, AGENT_FILE_CHANGE_REPORT_MAX_PATH_LENGTH, @@ -20,6 +20,23 @@ function capturedWorkspace(cwd: string, additionalDirectories: string[] = []) { return captureAgentFileChangeWorkspace(cwd, additionalDirectories); } +function hideTemporaryDirectoryAncestorGitMarkers() { + const markers = new Set(); + let directory = path.resolve(os.tmpdir()); + while (true) { + markers.add(path.join(directory, ".git")); + const parent = path.dirname(directory); + if (parent === directory) break; + directory = parent; + } + const existsSync = fs.existsSync; + // These fixtures need lexical ancestor discovery to stop without finding a + // repository outside the fixture, even when the host temp directory has one. + return vi.spyOn(fs, "existsSync").mockImplementation(filename => + typeof filename === "string" && markers.has(filename) ? false : existsSync(filename), + ); +} + describe("agent file-change report", () => { it("accepts only a versioned request with a bounded opaque id", () => { expect(parseAgentFileChangeReportRequest({ @@ -228,6 +245,7 @@ describe("agent file-change report", () => { const realRoot = fs.mkdtempSync(path.join(os.tmpdir(), "file-report-real-")); const linkedRoot = `${realRoot}-link`; fs.symlinkSync(realRoot, linkedRoot, "dir"); + const ancestorMarkers = hideTemporaryDirectoryAncestorGitMarkers(); try { const report = createReportedAgentFileChangeReport( "request-symlink-root", @@ -236,6 +254,7 @@ describe("agent file-change report", () => { ); expect(report.paths).toEqual([path.join(fs.realpathSync.native(realRoot), "generated.ts")]); } finally { + ancestorMarkers.mockRestore(); fs.unlinkSync(linkedRoot); fs.rmSync(realRoot, {recursive: true, force: true}); } @@ -250,6 +269,7 @@ describe("agent file-change report", () => { fs.mkdirSync(path.join(repository, ".git")); fs.mkdirSync(realCwd, {recursive: true}); fs.symlinkSync(realCwd, linkedCwd, "dir"); + const ancestorMarkers = hideTemporaryDirectoryAncestorGitMarkers(); try { const report = createReportedAgentFileChangeReport( "request-symlink-nested-cwd", @@ -259,6 +279,7 @@ describe("agent file-change report", () => { expect(report.paths).toEqual([path.join(fs.realpathSync.native(realCwd), "src", "Main.ts")]); } finally { + ancestorMarkers.mockRestore(); fs.unlinkSync(linkedCwd); fs.rmSync(repository, {recursive: true, force: true}); }