@@ -277,10 +277,6 @@ func (c *Client) WaitForServerReady(ctx context.Context) error {
277 // Set initial state
277 // Set initial state
278 c.SetServerState(StateStarting)
278 c.SetServerState(StateStarting)
280− // Create a context with timeout
281− ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
284 // Try to ping the server with a simple request
280 // Try to ping the server with a simple request
285 ticker := time.NewTicker(500 * time.Millisecond)
281 ticker := time.NewTicker(500 * time.Millisecond)
286 defer ticker.Stop()
282 defer ticker.Stop()
@@ -495,14 +491,9 @@ func (c *Client) RegisterServerRequestHandler(method string, handler transport.H
496// openKeyConfigFiles opens important configuration files that help initialize the server.
492// openKeyConfigFiles opens important configuration files that help initialize the server.
497func (c *Client) openKeyConfigFiles(ctx context.Context) {
493func (c *Client) openKeyConfigFiles(ctx context.Context) {
498− wd, err := os.Getwd()
503 // Try to open each file, ignoring errors if they don't exist
494 // Try to open each file, ignoring errors if they don't exist
504 for _, file := range c.config.RootMarkers {
495 for _, file := range c.config.RootMarkers {
505− file = filepath.Join(wd, file)
496+ file = filepath.Join(c.cwd, file)
506 if _, err := os.Stat(file); err == nil {
497 if _, err := os.Stat(file); err == nil {
507 // File exists, try to open it
498 // File exists, try to open it
508 if err := c.OpenFile(ctx, file); err != nil {
499 if err := c.OpenFile(ctx, file); err != nil {