{"record":{"id":"f452c022ba35b3e7","repo":"chenhg5/cc-connect","slug":"resolve-current-directory-w","errorCode":null,"errorMessage":"resolve current directory: %w","messagePattern":"resolve current directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/engine.go","lineNumber":11500,"sourceCode":"\t\treturn \"\", fmt.Errorf(\"work_dir is required\")\n\t}\n\tif dir == \"~\" || strings.HasPrefix(dir, \"~/\") {\n\t\thome, err := os.UserHomeDir()\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"resolve home directory: %w\", err)\n\t\t}\n\t\tif dir == \"~\" {\n\t\t\tdir = home\n\t\t} else {\n\t\t\tdir = filepath.Join(home, strings.TrimPrefix(dir, \"~/\"))\n\t\t}\n\t}\n\tif !filepath.IsAbs(dir) {\n\t\tif strings.TrimSpace(base) == \"\" {\n\t\t\tvar err error\n\t\t\tbase, err = os.Getwd()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"resolve current directory: %w\", err)\n\t\t\t}\n\t\t}\n\t\tdir = filepath.Join(base, dir)\n\t}\n\tabs, err := filepath.Abs(filepath.Clean(dir))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn abs, nil\n}\n\n// SendTTSToSession synthesizes and sends a voice message to an active session.\n// It is used by the local API/CLI so agents can call `cc-connect send --tts`.\nfunc (e *Engine) SendTTSToSession(sessionKey, text string) error {\n\ttext = strings.TrimSpace(text)\n\tif text == \"\" {\n\t\treturn fmt.Errorf(\"tts text is required\")\n\t}","sourceCodeStart":11482,"sourceCodeEnd":11518,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/engine.go#L11482-L11518","documentation":"normalizeSendWorkDir could not resolve the base directory for a relative work_dir path: no base was supplied and os.Getwd() failed (e.g. working directory was deleted). Wraps the OS error before joining the relative path.","triggerScenarios":"Thrown at core/engine.go:11500 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an absolute work_dir","Ensure the process still has a valid working directory (cwd not deleted)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}