feat(code): dcode_term_program trace metadata - #5329
Merged
Mason Daugherty (mdrxy) merged 2 commits intoAug 5, 2026
Conversation
`build_stream_config` read `TERM_PROGRAM` with a bare truthiness guard, so a shell exporting `TERM_PROGRAM=" "` stamped `dcode_term_program = " "` — a junk trace-grouping bucket. Every other reader of this variable normalizes with `.strip()` and treats blank as unset (`config_manifest.py`, `app.py`, `tui/widgets/theme_selector.py`), a convention pinned by dedicated tests in `test_theme.py`. Match it here. Also deny `TERM_PROGRAM` from a project `.env`: python-dotenv expands environment-variable references, so a cloned repo could otherwise forward a launch-environment value to the trace backend. Move the value-level `dcode_term_program` tests to `TestBuildStreamConfig`, alongside every other `build_stream_config` diagnostic key, and cover the empty and whitespace-only cases. `test_coding_agent_metadata.py` is scoped to `coding-agent-v1` contract compliance, so it keeps one test asserting the non-contract key stays contract-valid on every trace-wide run type with `TERM_PROGRAM` pinned rather than inherited from the runner's shell.
Mason Daugherty (mdrxy)
deleted the
mdrxy/code/term-program-trace-metadata
branch
August 5, 2026 22:24
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Aug 6, 2026
> [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Release notes preview: keep this section in sync with the package `CHANGELOG.md`. Publish reads the merged CHANGELOG via `release.yml`, not this PR description — keep them aligned anyway so the PR stays an accurate historical record for reviewers and anyone returning later._ --- ## [0.1.53](deepagents-code==0.1.52...deepagents-code==0.1.53) (2026-08-06) ### Features - Added pricing coverage with Baseten built-in overrides and local fallback overrides when `genai-prices` is missing data ([#5312](#5312), [#5304](#5304)). - Suggest compacting large resumed threads ([#5318](#5318)). - Added terminal program trace metadata ([#5329](#5329)). ### Bug Fixes - Preserved runtime offload archive routing ([#5328](#5328)). - Always restart after a successful startup auto-update ([#5317](#5317)). - Fixed leaked turn coroutines and SQLite handles ([#5218](#5218)). - Keep MCP shutdown-race tracebacks from appearing in the terminal ([#5325](#5325)). - Open the `/auto model` selector immediately while connecting ([#5341](#5341)). - Route failures to `PostToolUseFailure` ([#5315](#5315)). - Use dismissed copy for ask-user prompts ([#5331](#5331)). _End release notes preview._ --- > [!NOTE] > A **New Contributors** section is appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 2). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: langchain-oss-automated-triage[bot] <248757908+langchain-oss-automated-triage[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dcode traces now record the host terminal as
dcode_term_program(fromTERM_PROGRAM, e.g. "iTerm.app", "vscode", "Apple_Terminal"), making runs groupable and filterable by launch environment in LangSmith.This is a diagnostic key stamped by
build_stream_configalongside the existingdcode_experimentalanddcode_auto_approveflags — not part of thecoding-agent-v1contract, so it deliberately lives outsidebuild_coding_agent_metadataand is omitted whenTERM_PROGRAMis unset.