{"record":{"id":"bb814a186e4675b2","repo":"multica-ai/multica","slug":"read-existing-task-context-marker-w","errorCode":null,"errorMessage":"read existing task context marker: %w","messagePattern":"read existing task context marker: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/context.go","lineNumber":227,"sourceCode":"\t}\n\t// The sidecar manifest removes this marker on normal local_directory\n\t// cleanup. If a crash leaves it behind, the CLI intentionally treats it\n\t// as daemon context and fails closed instead of using a user PAT.\n\tpayload := taskContextMarkerFile{\n\t\tManagedBy: TaskContextMarkerManagedBy,\n\t\tAgentID:   ctx.AgentID,\n\t\tIssueID:   ctx.IssueID,\n\t}\n\tdata, err := json.MarshalIndent(payload, \"\", \"  \")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshal task context marker: %w\", err)\n\t}\n\tif err := recordWriteFile(filepath.Join(workDir, TaskContextMarkerRelPath), data, 0o644, manifest); err != nil {\n\t\tif errors.Is(err, errPathPreExists) {\n\t\t\tpath := filepath.Join(workDir, TaskContextMarkerRelPath)\n\t\t\texisting, readErr := os.ReadFile(path)\n\t\t\tif readErr != nil {\n\t\t\t\treturn fmt.Errorf(\"read existing task context marker: %w\", readErr)\n\t\t\t}\n\t\t\tvar marker taskContextMarkerFile\n\t\t\tif json.Unmarshal(existing, &marker) != nil || marker.ManagedBy != TaskContextMarkerManagedBy {\n\t\t\t\treturn fmt.Errorf(\"write task context marker: %w\", err)\n\t\t\t}\n\t\t\tif writeErr := os.WriteFile(path, data, 0o644); writeErr != nil {\n\t\t\t\treturn fmt.Errorf(\"refresh task context marker: %w\", writeErr)\n\t\t\t}\n\t\t\tif manifest != nil {\n\t\t\t\tmanifest.Files = append(manifest.Files, path)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"write task context marker: %w\", err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/context.go#L209-L245","documentation":"Error \"read existing task context marker: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/daemon/execenv/context.go:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete or fix the corrupted task context marker file."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}