{"record":{"id":"71ade87181bf57f8","repo":"langchain-ai/deepagents","slug":"workspace-configuration-does-not-match-thread-thr","errorCode":null,"errorMessage":"workspace configuration does not match thread {thread_id}","messagePattern":"workspace configuration does not match thread (.+?)","errorType":"exception","errorClass":"WorkspaceConflictError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/workspace.py","lineNumber":369,"sourceCode":"            _initialize(conn)\n            row = conn.execute(\n                \"SELECT * FROM dcode_thread_workspaces WHERE thread_id = ?\",\n                (thread_id,),\n            ).fetchone()\n            if row is None:\n                msg = f\"thread {thread_id} has no workspace binding\"\n                raise WorkspaceConflictError(msg)\n            existing = _row_binding(row)\n            expected = existing.to_payload()\n            if any(data.get(key) != value for key, value in expected.items()):\n                msg = f\"workspace context does not match thread {thread_id}\"\n                raise WorkspaceConflictError(msg)\n            if (\n                claimed_fingerprint is not None\n                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":351,"sourceCodeEnd":386,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/workspace.py#L351-L386","documentation":"`require_thread_workspace._require` compares the claimed config fingerprint (`canonical_workspace_config(workspace_config)` hash, or the supplied `config_fingerprint`) with the fingerprint persisted at bind time. This `WorkspaceConflictError` means the workspace configuration content changed since the thread was bound, even if the context fields match.","triggerScenarios":"Calling `require_thread_workspace` with a `workspace_config` whose canonical JSON differs from the one at bind time, or passing an explicit `config_fingerprint` that does not match the stored one; editing config values (policy, resource settings) between runs of the same thread.","commonSituations":"Tweaking workspace settings mid-session and re-running the same thread; a key ordering/value normalization change altering the canonical serialization; a library upgrade changing canonicalization; copying a config from another project.","solutions":["Pass the exact same workspace_config (or config_fingerprint) used when the thread was bound","Start a new thread with the new configuration instead of mutating the bound one","If a library upgrade changed canonicalization, re-bind the thread under a fresh id"],"exampleFix":"// before\nrequire_thread_workspace(tid, payload=ctx, workspace_config={\"policy\": \"strict\"})  # bound with \"default\"\n// after\nrequire_thread_workspace(tid, payload=ctx, workspace_config={\"policy\": \"default\"})","handlingStrategy":"try-catch","validationCode":"claimed_fp, _ = canonical_workspace_config(workspace_config)\nstored_fp = binding.config_fingerprint\nif claimed_fp != stored_fp:\n    raise WorkspaceConflictError(\"config changed; use a new thread\")","typeGuard":null,"tryCatchPattern":"try:\n    await require_thread_workspace(tid, payload=ctx, workspace_config=cfg)\nexcept WorkspaceConflictError as exc:\n    if \"configuration does not match\" in str(exc):\n        tid = new_thread_id()  # new config -> new thread\n        await bind_thread_workspace(tid, cwd, workspace_config=cfg)","preventionTips":["Treat workspace_config as immutable for a thread's lifetime","Store the config and reuse the identical object across runs","Compare fingerprints before running when config is dynamic"],"tags":["workspace","conflict","fingerprint","config"],"backgroundTag":"workspace-config-fingerprint-mismatch","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}