{"record":{"id":"3c9307f50a067963","repo":"langchain-ai/deepagents","slug":"workspace-identity-changed-for-thread-thread-id","errorCode":null,"errorMessage":"workspace identity changed for thread {thread_id}","messagePattern":"workspace identity changed for thread (.+?)","errorType":"exception","errorClass":"WorkspaceConflictError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/workspace.py","lineNumber":384,"sourceCode":"                and claimed_fingerprint != existing.config_fingerprint\n            ):\n                msg = f\"workspace configuration does not match thread {thread_id}\"\n                raise WorkspaceConflictError(msg)\n            return existing\n\n    existing = await asyncio.to_thread(_require)\n    if existing.schema_version != _SCHEMA_VERSION:\n        msg = f\"workspace binding schema is unsupported for thread {thread_id}\"\n        raise WorkspaceConflictError(msg)\n    resolved = await asyncio.to_thread(\n        resolve_workspace,\n        existing.cwd,\n        existing.workspace_config(),\n        config_fingerprint=existing.config_fingerprint,\n    )\n    if resolved.workspace_id != existing.workspace_id:\n        msg = f\"workspace identity changed for thread {thread_id}\"\n        raise WorkspaceConflictError(msg)\n    return existing\n","sourceCodeStart":366,"sourceCodeEnd":386,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/workspace.py#L366-L386","documentation":"After loading a thread's workspace binding, `require_thread_workspace` re-resolves the workspace from the binding's `cwd` + config and compares the resulting `workspace_id` to the one recorded at bind time. A mismatch means the directory/config now resolves to a different workspace identity than the thread was bound to, so the library refuses to run against it via `WorkspaceConflictError` to avoid operating on the wrong workspace.","triggerScenarios":"Calling `make_graph` or `_execute_offload` for a thread whose binding's `cwd` was moved/renamed/replaced, or whose `workspace_config()` / `config_fingerprint` changed so `resolve_workspace` yields a different `workspace_id` than stored.","commonSituations":"Renaming or replacing the working directory after the thread was created; editing workspace config files; pointing two threads at swapped directories; restoring a directory from a different source.","solutions":["Restore the workspace directory/config to match the original binding (undo the rename or revert the config change).","Delete and recreate the thread's workspace binding so it re-resolves and stores the current `workspace_id`.","Verify with `resolve_workspace(existing.cwd, existing.workspace_config())` what identity it now produces, and reconcile it with the stored binding."],"exampleFix":"// before: cwd renamed after binding\nmv ./ws ./ws-renamed\n// after: keep the bound path stable, or rebind\nrm binding-for-t-1\nawait create_thread_workspace(thread_id=\"t-1\", cwd=\"./ws-renamed\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    binding = await require_thread_workspace(thread_id)\nexcept WorkspaceConflictError as e:\n    if \"identity changed\" in str(e):\n        binding = await recreate_binding(thread_id, cwd=current_cwd)\n    else:\n        raise","preventionTips":["Do not move, rename, or reconfigure a workspace directory while threads are bound to it.","Re-resolve the workspace after any directory/config change and rebind affected threads.","Keep one canonical workspace path per thread; avoid symlink swapping."],"tags":["workspace","identity","conflict","state"],"backgroundTag":"workspace-identity-changed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}