{"record":{"id":"8c6ff05740285001","repo":"chenhg5/cc-connect","slug":"work-dir-q-w","errorCode":null,"errorMessage":"work_dir %q: %w","messagePattern":"work_dir %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/engine.go","lineNumber":11448,"sourceCode":"\t}\n\n\treturn sendTarget{\n\t\tstate:      state,\n\t\tplatform:   p,\n\t\treplyCtx:   replyCtx,\n\t\tsessionKey: resolvedSessionKey,\n\t}, nil\n}\n\nfunc (e *Engine) resolveSendWorkDir(workDir string) (string, bool, error) {\n\tcurrent := e.currentSendWorkDir()\n\ttarget, err := normalizeSendWorkDir(workDir, current)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\tinfo, err := os.Stat(target)\n\tif err != nil {\n\t\treturn \"\", false, fmt.Errorf(\"work_dir %q: %w\", target, err)\n\t}\n\tif !info.IsDir() {\n\t\treturn \"\", false, fmt.Errorf(\"work_dir %q is not a directory\", target)\n\t}\n\n\tif current != \"\" {\n\t\tif normalizedCurrent, err := normalizeSendWorkDir(current, \"\"); err == nil && normalizedCurrent == target {\n\t\t\treturn target, false, nil\n\t\t}\n\t}\n\treturn target, true, nil\n}\n\nfunc (e *Engine) currentSendWorkDir() string {\n\tif e.agent != nil {\n\t\tif wd, ok := e.agent.(interface{ GetWorkDir() string }); ok {\n\t\t\tif dir := strings.TrimSpace(wd.GetWorkDir()); dir != \"\" {\n\t\t\t\treturn dir","sourceCodeStart":11430,"sourceCodeEnd":11466,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/engine.go#L11430-L11466","documentation":"resolveSendWorkDir wrapped os.Stat failure for the resolved work_dir target: the directory does not exist or is inaccessible (permissions, bad mount). Fires when a send/send-to-session request specifies a work_dir that cannot be stat'ed after path normalization.","triggerScenarios":"Thrown at core/engine.go:11448 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the directory first (mkdir -p)","Check spelling and permissions of the configured work_dir"],"exampleFix":null,"handlingStrategy":"validation","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"}