feat(code): gate TERM_PROGRAM resume hints - #5580
Merged
Mason Daugherty (mdrxy) merged 3 commits intoAug 18, 2026
Merged
Conversation
Ambient terminal exports cannot be distinguished from launch-specific values, so keep resume-prefix propagation off unless the user opts in or runs in experimental/debug mode. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
marked this pull request as ready for review
August 18, 2026 05:36
`resolve_scalar` derives a `BOOL_MODE_DEFAULT` value from debug/experimental mode and returns before reading `option.default`, so a declared default is unreachable -- but `dcode config` still renders it, advertising `default False` for an option that is on. Reject a declared default for the kind at construction and drop it from `features.resume_term_program`, matching `debug.log_level`. Keep `_validate_invert_toml_bool` in sync with the `_coerce_toml` bool branch, which the kind was added to; without it the inversion path is unreachable for `BOOL_MODE_DEFAULT` options. Guard the config read behind the resume hint. `_render_teardown_thread_hints` runs from a bare `finally` in `cli_main` and documents that teardown output must never crash the exit path, but the new `_resume_term_program` call reads `config.toml` and was the one unguarded statement there; an exception would replace whatever is already unwinding, including the `KeyboardInterrupt` that produces exit code 130. Restore the rationale for the prefix (a shell alias exporting `TERM_PROGRAM` does not change `argv[0]`, so `invoked_name` cannot recover it) and for dropping rather than stripping control characters, and document that an empty env value reads as false. Cover the config.toml route to the hint, which the teardown tests previously stubbed out entirely, and the unrecognized-token fallthrough.
Mason Daugherty (mdrxy)
deleted the
mdrxy/code/resume-term-program-config
branch
August 18, 2026 14:48
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Aug 19, 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.58](deepagents-code==0.1.57...deepagents-code==0.1.58) (2026-08-19) ### Breaking Changes - `deepagents-code` now requires Python 3.12 or newer. ([#5603](#5603)) ### Features - Added OpenRouter `z-ai/glm-5.3` to the model switcher. ([#5641](#5641)) - Added support for re-authenticating MCP servers from the viewer. ([#5637](#5637)) - Footer pickers can now be opened with `ctrl+click`. ([#5611](#5611)) - Resume hints now account for `TERM_PROGRAM` support before showing terminal-specific guidance. ([#5580](#5580)) ### Fixes - Completed the `dcode config` command surface. ([#5581](#5581)) - Made `/offload` interruptible. ([#5590](#5590)) - Improved chat and footer UI behavior: rapid typing stays visible, double-click collapses a resized chat input, and the MCP footer wraps on narrow windows. ([#5424](#5424), [#5578](#5578), [#5651](#5651)) - Captured stdio MCP server stderr in the logger. ([#5610](#5610)) - Drained hook pipes after timeout. ([#5606](#5606)) - Grouped resume trace rounds. ([#5593](#5593)) - Omitted web-search prompt guidance when web search is unavailable. ([#5602](#5602)) - Resolved message pointer shapes per cell. ([#5592](#5592)) _End release notes preview._ --- > [!NOTE] > A **community contributors** list and a **Special thanks** section (crediting the users who filed the issues this release's PRs closed) are 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 3). --------- 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.
Related #5548
TERM_PROGRAMis now omitted from resume hints by default, with an explicit config opt-in that defaults on in experimental or debug mode.Ambient terminal exports cannot be distinguished from launch-specific values, so
features.resume_term_program/DEEPAGENTS_CODE_RESUME_TERM_PROGRAMcontrols propagation. An explicit true or false value overrides the mode-dependent default; existing quoting, launch snapshotting, and native-Windows safeguards remain intact.Test plan
make -C libs/code formatmake -C libs/code lintMade by Open SWE