From 81e74c54fdcbfd97599f4d92d0ebd96a4e11b755 Mon Sep 17 00:00:00 2001 From: Harmeet Singh Date: Sun, 22 Feb 2026 19:56:32 -0500 Subject: [PATCH 1/4] fix: put filePath before content in write tool schema --- packages/opencode/src/tool/write.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/tool/write.ts b/packages/opencode/src/tool/write.ts index 8c1e53ccaf3a..e9c590ca915d 100644 --- a/packages/opencode/src/tool/write.ts +++ b/packages/opencode/src/tool/write.ts @@ -19,8 +19,8 @@ const MAX_PROJECT_DIAGNOSTICS_FILES = 5 export const WriteTool = Tool.define("write", { description: DESCRIPTION, parameters: z.object({ - content: z.string().describe("The content to write to the file"), filePath: z.string().describe("The absolute path to the file to write (must be absolute, not relative)"), + content: z.string().describe("The content to write to the file"), }), async execute(params, ctx) { const filepath = path.isAbsolute(params.filePath) ? params.filePath : path.join(Instance.directory, params.filePath) From 181e123e361616a2cdb9ede37fa4914276ba501b Mon Sep 17 00:00:00 2001 From: Harmeet Singh Date: Fri, 6 Mar 2026 07:19:19 -0500 Subject: [PATCH 2/4] fix(e2e): always use forward slashes in @mention file path test The mention search query is passed to the backend as-is, so using backslashes on Windows produced no suggestions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/app/e2e/prompt/prompt-mention.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/app/e2e/prompt/prompt-mention.spec.ts b/packages/app/e2e/prompt/prompt-mention.spec.ts index 5cc9f6e68505..f9b72fe65385 100644 --- a/packages/app/e2e/prompt/prompt-mention.spec.ts +++ b/packages/app/e2e/prompt/prompt-mention.spec.ts @@ -5,8 +5,7 @@ test("smoke @mention inserts file pill token", async ({ page, gotoSession }) => await gotoSession() await page.locator(promptSelector).click() - const sep = process.platform === "win32" ? "\\" : "/" - const file = ["packages", "app", "package.json"].join(sep) + const file = ["packages", "app", "package.json"].join("/") const filePattern = /packages[\\/]+app[\\/]+\s*package\.json/ await page.keyboard.type(`@${file}`) From 39e53719c060bd37d3da0d6577d6068577a08e7b Mon Sep 17 00:00:00 2001 From: Harmeet Singh Date: Sat, 7 Mar 2026 10:05:32 -0500 Subject: [PATCH 3/4] fix(acp): resolve implicit any types in getContextLimit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/opencode/src/acp/agent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/acp/agent.ts b/packages/opencode/src/acp/agent.ts index d518dd12a1a4..911fdb978aee 100644 --- a/packages/opencode/src/acp/agent.ts +++ b/packages/opencode/src/acp/agent.ts @@ -60,7 +60,7 @@ export namespace ACP { directory: string, ): Promise { const providers = await sdk.config - .providers({ directory }) + .providers({ directory }, { throwOnError: true }) .then((x) => x.data?.providers ?? []) .catch((error) => { log.error("failed to get providers for context limit", { error }) From 73464e9d5e07e9255a961bc44fa17a3fa0f7fb94 Mon Sep 17 00:00:00 2001 From: Harmeet Singh Date: Sat, 7 Mar 2026 12:32:59 -0500 Subject: [PATCH 4/4] fix(file): await initial scan before returning file index On slow environments (Windows CI), the ripgrep scan of the project could still be in progress when the first @mention search fired, returning an empty file list and no suggestions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/opencode/src/file/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/file/index.ts b/packages/opencode/src/file/index.ts index 01f07c9afaab..fb0f7afdc215 100644 --- a/packages/opencode/src/file/index.ts +++ b/packages/opencode/src/file/index.ts @@ -395,10 +395,11 @@ export namespace File { cache = result fetching = false } - fn(cache) + const initialScan = fn(cache) return { async files() { + await initialScan if (!fetching) { fn({ files: [],