fix(code): record shell output as user context#4353
Merged
Conversation
Mason Daugherty (mdrxy)
added a commit
that referenced
this pull request
Jun 29, 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). --- _Everything below this line will be the GitHub release body._ --- ## [0.1.28](deepagents-code==0.1.27...deepagents-code==0.1.28) (2026-06-29) ### Features * Add Fireworks session settings ([#4360](#4360)) ([90ebb1d](90ebb1d)) * `RubricMiddleware` implementation (`/goal`/`--goal` and `/rubric`/`--rubric`) * Add rubric-backed goal workflow ([#4365](#4365)) ([8fca61d](8fca61d)) * Non-interactive rubric grading flags ([#4305](#4305)) ([1bcb112](1bcb112)) * Adopt coding-agent-v1 trace metadata ([#4367](#4367)) ([cb39747](cb39747)) * Quit shortcut on completed update modal ([#4312](#4312)) ([5e6eae9](5e6eae9)) ### Bug Fixes * Redact LangSmith trace secrets by default ([#4356](#4356)) ([5e01fec](5e01fec)) * Honor Baseten base URL env precedence ([#4328](#4328)) ([8f20d74](8f20d74)) * Highlight just-installed provider on `/auth` reopen ([#4311](#4311)) ([85e47b5](85e47b5)) * Clear transient update launch status ([#4355](#4355)) ([b870b18](b870b18)) * Clearer MCP config JSON parse errors ([#4327](#4327)) ([9cee602](9cee602)) * Record shell output as user context ([#4353](#4353)) ([0d504a5](0d504a5)) * Suppress expected MCP reauth logs ([#4359](#4359)) ([15ee384](15ee384)) ### Performance Improvements * Background refresh for `@` file completion cache ([#3911](#3911)) ([aa22d6b](aa22d6b)) * Speed up shutdown after `Ctrl+C`/`Ctrl+D` ([#4351](#4351)) ([db441ed](db441ed)) --- _Everything above this line will be the GitHub release body._ --- > [!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: Mason Daugherty <github@mdrxy.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.
Local
!commands are user-initiated environment context, not assistant-authored output. Before this change, dcode represented a non-incognito shell command as a syntheticHumanMessage/AIMessagepair:That made shell output look like something the model said, which is misleading in traces and can confuse downstream history consumers. This switches the model-visible record to a single structured user-context message, matching the pattern used by tools like Codex for user-entered shell commands:
Agent-invoked shell tools can still use normal tool-call/tool-result semantics. This change is only for user-entered
!commands that run outside the agent graph and are later flushed into the thread state before the next user turn.Changes
DeepAgentsApp._buffer_shell_for_model_contextto append one structuredHumanMessageper!command instead of aHumanMessagecommand plus syntheticAIMessageoutput.Exit code: unknownfor interrupted/timeout paths where the subprocess has no return code.!!incognito commands and--startup-cmdoutput stay local-only, and non-incognito!output is still deferred until the next user send.