fix: custom-dir session create used user input not server directory (scope drift)
onCreateInDirectory navigated with dir.trim() (raw user input) while the sibling create paths use the server-authoritative session.directory. When the opencode server normalizes the path (trailing slash/symlink/relative), the nav param diverged from the session's real scope, causing the new session/[id] screen to scope to the wrong client -> 'Failed to load session'. Mirror the sibling paths' session.directory spread. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -215,7 +215,10 @@ export default function SessionsScreen() {
|
|||||||
setShowNewSession(false)
|
setShowNewSession(false)
|
||||||
setCustomDir("")
|
setCustomDir("")
|
||||||
if (session) {
|
if (session) {
|
||||||
router.push({ pathname: `/session/[id]`, params: { id: session.id, directory: dir.trim() } })
|
router.push({
|
||||||
|
pathname: `/session/[id]`,
|
||||||
|
params: { id: session.id, ...(session.directory ? { directory: session.directory } : {}) },
|
||||||
|
})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to create session in directory:", error)
|
console.error("Failed to create session in directory:", error)
|
||||||
|
|||||||
Reference in New Issue
Block a user