From ee7082a72a0161bd6eba29fd90b5857c00ca77a4 Mon Sep 17 00:00:00 2001 From: engineer Date: Tue, 2 Jun 2026 01:52:04 -0700 Subject: [PATCH] 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 --- app/(tabs)/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 1860250..2800a34 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -215,7 +215,10 @@ export default function SessionsScreen() { setShowNewSession(false) setCustomDir("") 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) { console.error("Failed to create session in directory:", error)