@@ -104,6 +104,7 @@ import {
104104 isVisibleTextPart ,
105105 isTauriRuntime ,
106106 modelEquals ,
107+ normalizeDirectoryQueryPath ,
107108 normalizeDirectoryPath ,
108109} from "./utils" ;
109110import { currentLocale , setLocale , t , type Language } from "../i18n" ;
@@ -2513,7 +2514,7 @@ export default function App() {
25132514 if ( ! directory ) {
25142515 try {
25152516 const pathInfo = unwrap ( await c . path . get ( ) ) ;
2516- const discovered = normalizeDirectoryPath ( pathInfo . directory ?? "" ) ;
2517+ const discovered = normalizeDirectoryQueryPath ( pathInfo . directory ?? "" ) ;
25172518 if ( discovered ) {
25182519 directory = discovered ;
25192520 c = createClient ( config . baseUrl , directory , config . auth ) ;
@@ -2523,13 +2524,7 @@ export default function App() {
25232524 }
25242525 }
25252526
2526- const queryDirectory = ( ( ) => {
2527- const trimmed = ( directory ?? "" ) . trim ( ) ;
2528- if ( ! trimmed ) return undefined ;
2529- const unified = trimmed . replace ( / \\ / g, "/" ) ;
2530- const withoutTrailing = unified . replace ( / \/ + $ / , "" ) ;
2531- return withoutTrailing || "/" ;
2532- } ) ( ) ;
2527+ const queryDirectory = normalizeDirectoryQueryPath ( directory ) || undefined ;
25332528
25342529 // Fetch sessions scoped to the workspace directory to avoid loading the
25352530 // full global session list for every workspace.
@@ -4342,7 +4337,7 @@ export default function App() {
43424337 if ( ! resolvedProjectDir ) {
43434338 try {
43444339 const pathInfo = unwrap ( await activeClient . path . get ( ) ) ;
4345- const discoveredRaw = normalizeDirectoryPath ( pathInfo . directory ?? "" ) ;
4340+ const discoveredRaw = normalizeDirectoryQueryPath ( pathInfo . directory ?? "" ) ;
43464341 const discovered = discoveredRaw . replace ( / ^ \/ p r i v a t e \/ t m p (? = \/ | $ ) / , "/tmp" ) ;
43474342 if ( discovered ) {
43484343 resolvedProjectDir = discovered ;
@@ -4532,7 +4527,7 @@ export default function App() {
45324527 if ( ! resolvedProjectDir ) {
45334528 try {
45344529 const pathInfo = unwrap ( await activeClient . path . get ( ) ) ;
4535- const discoveredRaw = normalizeDirectoryPath ( pathInfo . directory ?? "" ) ;
4530+ const discoveredRaw = normalizeDirectoryQueryPath ( pathInfo . directory ?? "" ) ;
45364531 const discovered = discoveredRaw . replace ( / ^ \/ p r i v a t e \/ t m p (? = \/ | $ ) / , "/tmp" ) ;
45374532 if ( discovered ) {
45384533 resolvedProjectDir = discovered ;
0 commit comments