Skip to content
Open
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
3 changes: 1 addition & 2 deletions packages/app/e2e/prompt/prompt-mention.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/acp/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export namespace ACP {
directory: string,
): Promise<number | null> {
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 })
Expand Down
3 changes: 2 additions & 1 deletion packages/opencode/src/file/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/tool/write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading