# reconcile_tracing_environment

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/config/reconcile_tracing_environment)

Publish a workspace's tracing settings to the process environment.

Redaction and project naming decide from the active workspace snapshot, but
the LangSmith SDK reads `os.environ` directly. Left to diverge, the snapshot
can say "not tracing" while the SDK traces on -- uploading unredacted -- or
the reverse, where the TUI offers `/trace` and nothing is ever ingested.

Writes the canonical name, resolving `DEEPAGENTS_CODE_`-prefixed overrides
first, because the SDK only reads canonical names. A var the workspace does
not set is removed, so the previous workspace's `.env` cannot linger.

Remember the environment before publication so later workspace previews
can recover shell values and remove earlier dotenv contributions.

The SDK caches env reads, so its caches are dropped afterwards.

## Signature

```python
reconcile_tracing_environment(
    environ: Mapping[str, str],
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `environ` | `Mapping[str, str]` | Yes | The active workspace environment snapshot. |

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/config.py#L1068)