mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-01 06:42:26 +00:00
fix: properly encode file URLs with special characters (#12424)
This commit is contained in:
committed by
GitHub
parent
e9a3cfc083
commit
fde0b39b7c
@@ -32,7 +32,7 @@ import { Flag } from "../flag/flag"
|
||||
import { ulid } from "ulid"
|
||||
import { spawn } from "child_process"
|
||||
import { Command } from "../command"
|
||||
import { $, fileURLToPath } from "bun"
|
||||
import { $, fileURLToPath, pathToFileURL } from "bun"
|
||||
import { ConfigMarkdown } from "../config/markdown"
|
||||
import { SessionSummary } from "./summary"
|
||||
import { NamedError } from "@opencode-ai/util/error"
|
||||
@@ -210,7 +210,7 @@ export namespace SessionPrompt {
|
||||
if (stats.isDirectory()) {
|
||||
parts.push({
|
||||
type: "file",
|
||||
url: `file://${filepath}`,
|
||||
url: pathToFileURL(filepath).href,
|
||||
filename: name,
|
||||
mime: "application/x-directory",
|
||||
})
|
||||
@@ -219,7 +219,7 @@ export namespace SessionPrompt {
|
||||
|
||||
parts.push({
|
||||
type: "file",
|
||||
url: `file://${filepath}`,
|
||||
url: pathToFileURL(filepath).href,
|
||||
filename: name,
|
||||
mime: "text/plain",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user