fix: opencode hanging when using client.app.log() during initialization (#11642)
This commit is contained in:
@@ -185,12 +185,15 @@ export namespace Server {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
.use(async (c, next) => {
|
.use(async (c, next) => {
|
||||||
let directory = c.req.query("directory") || c.req.header("x-opencode-directory") || process.cwd()
|
if (c.req.path === "/log") return next()
|
||||||
try {
|
const raw = c.req.query("directory") || c.req.header("x-opencode-directory") || process.cwd()
|
||||||
directory = decodeURIComponent(directory)
|
const directory = (() => {
|
||||||
} catch {
|
try {
|
||||||
// fallback to original value
|
return decodeURIComponent(raw)
|
||||||
}
|
} catch {
|
||||||
|
return raw
|
||||||
|
}
|
||||||
|
})()
|
||||||
return Instance.provide({
|
return Instance.provide({
|
||||||
directory,
|
directory,
|
||||||
init: InstanceBootstrap,
|
init: InstanceBootstrap,
|
||||||
|
|||||||
Reference in New Issue
Block a user