fix(code): resume hints echo the launched command name - #5119
Merged
Conversation
Resume hints hardcoded `dcode`, so users who launch through the `deepagents-code` alias or a renamed per-checkout shim were told to run a command they may not have. Resolve the launch name from `sys.argv[0]`, carrying it across the auto-update re-exec (which drops argv[0]) in an internal env sentinel, and fall back to `dcode` when the name is not a plausible command. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
added a commit
that referenced
this pull request
Jul 28, 2026
PR descriptions that mention `release-note-ready` text still led agents
to append a separate `## Release Note` section that duplicated the
frontmatter summary. Clarifies that the plain paragraph above `---` is
the release note, bans both heading casings, and shows the anti-pattern.
---
The release-note content already belongs in the unlabeled opening
summary. Agents were treating "release-note-ready" as a cue to add a
second section. Tightens the wording in contributor agent guidance and
the GitHub PR template so the rule is positive ("that paragraph is the
release note") and includes a concrete bad example.
Related #5119
---------
Signed-off-by: Mason Daugherty <mason@langchain.dev>
Mason Daugherty (mdrxy)
marked this pull request as ready for review
July 29, 2026 19:11
…verage The env-var drift test flags DEEPAGENTS_CODE_INVOKED_AS as lacking a manifest entry. It is an internal sentinel set by the self-update restart handshake to carry the launched command name into the re-exec'd process — never user-configured — so it belongs in NON_OPTION_ENV_VARS alongside the other internal/transient signaling flags.
When dcode is launched through a renamed shim or alias, resume hints echo that name, and a wrong hint was previously impossible to trace back to how the launch name was resolved. cli_main now logs a once-per-process note naming the resolved command when it is not one of the shipped console scripts (dcode, deepagents-code). The note is never user-facing: it logs at INFO when debug mode is off so it passes the package logger's buffer floor and lands only in the in-app Debug Console (the buffer is the sole handler, so nothing prints), and at DEBUG when DEEPAGENTS_CODE_DEBUG is on so it also joins the debug log file.
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
…n-ai#5121) PR descriptions that mention `release-note-ready` text still led agents to append a separate `## Release Note` section that duplicated the frontmatter summary. Clarifies that the plain paragraph above `---` is the release note, bans both heading casings, and shows the anti-pattern. --- The release-note content already belongs in the unlabeled opening summary. Agents were treating "release-note-ready" as a cue to add a second section. Tightens the wording in contributor agent guidance and the GitHub PR template so the rule is positive ("that paragraph is the release note") and includes a concrete bad example. Related langchain-ai#5119 --------- Signed-off-by: Mason Daugherty <mason@langchain.dev>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
…5119) Resume hints now name the command you actually launched — `deepagents-code`, or a renamed shim such as `abc` — instead of always saying `dcode`. --- The package ships two console scripts (`dcode` and `deepagents-code`), and a common way to run several checkouts side by side is a renamed symlink in `~/.local/bin` pointing at a worktree's `dcode` script. Both resume hints (the teardown "Resume this thread with:" line and the relaunch hint after an agent switch) hardcoded `dcode`, so those users were told to run a command that may not exist on their `PATH`. The launch name is recoverable: for a shebang console script the kernel hands the interpreter the pathname passed to `execve` rather than the symlink target, so `sys.argv[0]` keeps the shim name. `invoked_name` resolves it and falls back to `dcode` when the value cannot be a command the user typed — `python -m deepagents_code` reports `__main__.py`, an embedded interpreter may leave `sys.argv` empty, and the value is rendered into a copy-pasteable command, so the shape is allowlisted rather than escaped. The startup auto-update re-execs as `python -m deepagents_code`, which discards `argv[0]`, so the resolved name is handed to the next generation through an internal env sentinel (the same pattern as the existing restart loop-guard sentinel). Deliberately out of scope: the hand-maintained `--help` usage lines still hardcode `dcode`. That is a mechanical swap of roughly a hundred literals guarded by the help-screen drift test, and is better reviewed on its own. Made by [Open SWE](https://openswe.vercel.app/agents/42e64bd7-ceac-c324-9036-69205c1754bc) --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Jul 30, 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.50](deepagents-code==0.1.49...deepagents-code==0.1.50) (2026-07-30) ### Highlights - Added project hooks workspace trust and expanded Hooks v2 support with client and server lifecycle events plus runtime feedback ([#5105](#5105), [#5104](#5104), [#4997](#4997), [#5045](#5045)). - Added an option to mute the “YOLO is active” toast ([#5103](#5103)). - Made the splash screen `thread` ID clickable to copy it ([#5173](#5173)). - Show `ask_user` answers directly on the answered tool row ([#5100](#5100)). - Show a toast when submitting an empty required `ask_user` answer ([#5095](#5095)). - Added thread message counts to the Debug Console ([#5117](#5117)). ### Fixes and improvements - Gated Hooks v2 behind `DEEPAGENTS_CODE_EXPERIMENTAL` and improved hook resume stability across identity and Command tool results ([#5146](#5146), [#5176](#5176)). - Kept server hook state out of task results ([#5164](#5164)). - Stopped duplicate Auto transcript events during interrupt replay ([#5157](#5157)). - Kept `/update` and `/install --package` prompts responsive ([#5127](#5127)). - Refreshed the `/threads` cache after each turn ([#5174](#5174)). - Anchored toasts above the chat input and added a toast when media is dropped into a free-text question ([#5101](#5101), [#5099](#5099)). - Improved thread status message styling and links ([#5118](#5118)). - Made resume hints echo the launched command name ([#5119](#5119)). - Scoped selection copy to the clicked screen ([#5140](#5140)). - Ignored mouse hits on detached widgets ([#5114](#5114)). _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> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
Mason Daugherty (mdrxy)
added a commit
that referenced
this pull request
Jul 30, 2026
Resume hints now name the command you actually launched — `deepagents-code`, or a renamed shim such as `abc` — instead of always saying `dcode`. --- The package ships two console scripts (`dcode` and `deepagents-code`), and a common way to run several checkouts side by side is a renamed symlink in `~/.local/bin` pointing at a worktree's `dcode` script. Both resume hints (the teardown "Resume this thread with:" line and the relaunch hint after an agent switch) hardcoded `dcode`, so those users were told to run a command that may not exist on their `PATH`. The launch name is recoverable: for a shebang console script the kernel hands the interpreter the pathname passed to `execve` rather than the symlink target, so `sys.argv[0]` keeps the shim name. `invoked_name` resolves it and falls back to `dcode` when the value cannot be a command the user typed — `python -m deepagents_code` reports `__main__.py`, an embedded interpreter may leave `sys.argv` empty, and the value is rendered into a copy-pasteable command, so the shape is allowlisted rather than escaped. The startup auto-update re-execs as `python -m deepagents_code`, which discards `argv[0]`, so the resolved name is handed to the next generation through an internal env sentinel (the same pattern as the existing restart loop-guard sentinel). Deliberately out of scope: the hand-maintained `--help` usage lines still hardcode `dcode`. That is a mechanical swap of roughly a hundred literals guarded by the help-screen drift test, and is better reviewed on its own. Made by [Open SWE](https://openswe.vercel.app/agents/42e64bd7-ceac-c324-9036-69205c1754bc) --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Jul 30, 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.50](deepagents-code==0.1.49...deepagents-code==0.1.50) (2026-07-30) ### Highlights - Added project hooks workspace trust and expanded Hooks v2 support with client and server lifecycle events plus runtime feedback ([#5105](#5105), [#5104](#5104), [#4997](#4997), [#5045](#5045)). - Added an option to mute the “YOLO is active” toast ([#5103](#5103)). - Made the splash screen `thread` ID clickable to copy it ([#5173](#5173)). - Show `ask_user` answers directly on the answered tool row ([#5100](#5100)). - Show a toast when submitting an empty required `ask_user` answer ([#5095](#5095)). - Added thread message counts to the Debug Console ([#5117](#5117)). ### Fixes and improvements - Gated Hooks v2 behind `DEEPAGENTS_CODE_EXPERIMENTAL` and improved hook resume stability across identity and Command tool results ([#5146](#5146), [#5176](#5176)). - Kept server hook state out of task results ([#5164](#5164)). - Stopped duplicate Auto transcript events during interrupt replay ([#5157](#5157)). - Kept `/update` and `/install --package` prompts responsive ([#5127](#5127)). - Refreshed the `/threads` cache after each turn ([#5174](#5174)). - Anchored toasts above the chat input and added a toast when media is dropped into a free-text question ([#5101](#5101), [#5099](#5099)). - Improved thread status message styling and links ([#5118](#5118)). - Made resume hints echo the launched command name ([#5119](#5119)). - Scoped selection copy to the clicked screen ([#5140](#5140)). - Ignored mouse hits on detached widgets ([#5114](#5114)). _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> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
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.
Resume hints now name the command you actually launched —
deepagents-code, or a renamed shim such asabc— instead of always sayingdcode.The package ships two console scripts (
dcodeanddeepagents-code), and a common way to run several checkouts side by side is a renamed symlink in~/.local/binpointing at a worktree'sdcodescript. Both resume hints (the teardown "Resume this thread with:" line and the relaunch hint after an agent switch) hardcodeddcode, so those users were told to run a command that may not exist on theirPATH.The launch name is recoverable: for a shebang console script the kernel hands the interpreter the pathname passed to
execverather than the symlink target, sosys.argv[0]keeps the shim name.invoked_nameresolves it and falls back todcodewhen the value cannot be a command the user typed —python -m deepagents_codereports__main__.py, an embedded interpreter may leavesys.argvempty, and the value is rendered into a copy-pasteable command, so the shape is allowlisted rather than escaped. The startup auto-update re-execs aspython -m deepagents_code, which discardsargv[0], so the resolved name is handed to the next generation through an internal env sentinel (the same pattern as the existing restart loop-guard sentinel).Deliberately out of scope: the hand-maintained
--helpusage lines still hardcodedcode. That is a mechanical swap of roughly a hundred literals guarded by the help-screen drift test, and is better reviewed on its own.Made by Open SWE