{"record":{"id":"f5e73777503be4f0","repo":"nikivdev/code","slug":"external-cli-link-points-to-manifest-with-misma","errorCode":null,"errorMessage":"external CLI link {} points to manifest with mismatched id {}","messagePattern":"external CLI link (.+?) points to manifest with mismatched id (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/external_cli.rs","lineNumber":406,"sourceCode":"                .map(|tool| tool.manifest_path.display().to_string())\n                .collect::<Vec<_>>()\n                .join(\", \");\n            bail!(\n                \"multiple external CLI manifests matched {}: {}\",\n                id,\n                locations\n            )\n        }\n    }\n}\n\nfn resolved_from_link_record(\n    record: &ExternalCliLinkRecord,\n    registration_path: Option<PathBuf>,\n) -> Result<ResolvedExternalCliTool> {\n    let manifest = read_manifest(&record.manifest_path)?;\n    if manifest.id != record.id {\n        bail!(\n            \"external CLI link {} points to manifest with mismatched id {}\",\n            record.id,\n            manifest.id\n        );\n    }\n    resolved_from_manifest(\n        record.manifest_path.clone(),\n        manifest,\n        ExternalCliResolutionKind::InstalledLink,\n        registration_path,\n    )\n}\n\nfn resolved_from_manifest(\n    manifest_path: PathBuf,\n    manifest: ExternalCliManifest,\n    resolution: ExternalCliResolutionKind,\n    registration_path: Option<PathBuf>,","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/external_cli.rs#L388-L424","documentation":"`resolved_from_link_record` validates that a link record still agrees with the manifest it points to. If the manifest at `record.manifest_path` declares a different `id` than the record's `id`, the link is stale or corrupt and the error reports both ids.","triggerScenarios":"Calling `resolve_installed_external_cli_tool`, `list_external_cli_tools`, or `install_external_cli_link` where a link record file references a manifest whose `id` field no longer matches `record.id` — typically because the manifest was edited, moved, or replaced after the link was created.","commonSituations":"The manifest at the target path was updated with a new id; a symlink now points at a different tool's manifest; the link record was hand-edited or copied from another tool.","solutions":["Re-create the link (re-run the install/link flow) so the record and manifest ids match again.","Edit the link record's `id` to match the manifest's current `id` if the rename was intentional.","Point the link record's `manifest_path` at the correct manifest for the recorded id.","Verify the manifest file at the recorded path wasn't overwritten by another tool."],"exampleFix":"# before (link record)\nid = \"old-name\"\nmanifest_path = \"/tools/new-name/tool.toml\"\n\n# after\nid = \"new-name\"\nmanifest_path = \"/tools/new-name/tool.toml\"","handlingStrategy":"validation","validationCode":"fn check_link_record(record: &ExternalCliLinkRecord) -> Result<(), String> {\n    let manifest = read_manifest(&record.manifest_path)\n        .map_err(|e| format!(\"link target unreadable: {e}\"))?;\n    if manifest.id != record.id {\n        return Err(format!(\"link id {} != manifest id {}\", record.id, manifest.id));\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match resolver.resolve_installed_external_cli_tool(&link_path) {\n    Err(e) if e.to_string().contains(\"mismatched id\") => {\n        eprintln!(\"stale link detected; re-linking...\");\n        installer.install_external_cli_link(&source)?;\n        resolver.resolve_installed_external_cli_tool(&link_path)\n    }\n    other => other,\n}","preventionTips":["Never hand-edit link records or manifests' `id` after linking.","Re-run the link flow whenever a manifest id changes.","Treat link records as generated artifacts (gitignore or regenerate them).","Periodically validate all link records against their manifests."],"tags":["external-cli","link-record","stale-state"],"backgroundTag":"stale-link-record","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}