fix(code): put local offloaded tool results on the real filesystem - #4740
Merged
Mason Daugherty (mdrxy) merged 7 commits intoJul 15, 2026
Conversation
In local mode, point `CompositeBackend.artifacts_root` at a stable, hardened per-user temp dir and drop the virtual `/large_tool_results/` route so offloaded tool results fall through to the default `LocalShellBackend` at a real path. The agent can now inspect them with `execute` (jq/grep/python) using the exact path the offload message hands it -- no virtual-path translation or copy-out/in. Conversation history keeps a dedicated route to persistent `~/.deepagents` storage. Uses the existing `CompositeBackend.artifacts_root` support, so this is a dcode-only change with no SDK edit. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
marked this pull request as ready for review
July 14, 2026 22:11
…artifacts-root # Conflicts: # libs/code/deepagents_code/agent.py
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Jul 16, 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`. The published GitHub release body is extracted from the merged `CHANGELOG.md` by `release.yml`, not from this PR description._ --- ## [0.1.40](deepagents-code==0.1.39...deepagents-code==0.1.40) (2026-07-16) ### Features - Added plugin marketplace support ([#4554](#4554)). - Added an “always allow” option to the project MCP approval prompt ([#4562](#4562)). - Improved `/goal` workflows: criteria generation now runs server-side, YOLO mode auto-accepts criteria, goals complete after satisfied grading, and goal review editing now supports `Ctrl+X` ([#4754](#4754), [#4784](#4784), [#4781](#4781), [#4780](#4780)). - Reasoning effort now persists across restarts ([#4728](#4728)). - Added a toast prompting you to re-paste when a chat paste collapses ([#4742](#4742)). ### Bug Fixes - Tool calls awaiting approval are now surfaced correctly ([#4739](#4739)). - Fixed transcript tail hydration when scrolled to the bottom edge ([#4733](#4733)). - Kept chat input responsive during MCP viewer `Ctrl+R` reconnects ([#4753](#4753)). - Improved inline free-text prompts by sharing paste handling and matching primary-input `Ctrl+D` behavior ([#4736](#4736), [#4729](#4729)). - Fixed local offloaded tool results to use the real filesystem ([#4740](#4740)). - Cleaned offloaded history when deleting a thread ([#4751](#4751)). - Removed duplicated content from the system prompt by overwriting the base prompt ([#4516](#4516)). - Closed subprocess transport during install teardown ([#4735](#4735)). - Added targeted `uv` constraints for prerelease dependencies ([#4744](#4744)). _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>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
…angchain-ai#4740) In dcode local mode, offloaded large tool results previously lived behind a virtual `CompositeBackend` route backed by a hidden `mkdtemp` `FilesystemBackend`. Because `execute` always runs on the default backend (never path-routed), the agent could not open those results with `jq`/`grep`/`python` by the path it was handed — the `/large_tool_results/` prefix wasn't a real inode, and the temp root was intentionally hidden. This points `CompositeBackend.artifacts_root` at a stable, hardened per-user temp dir and drops the `/large_tool_results/` route, so offloaded results fall through to the default `LocalShellBackend` at a real path. The agent can now inspect them with `execute` using the exact path the offload message hands it — no virtual-path translation, no copy-out/in. Conversation history keeps a dedicated route to persistent `~/.deepagents` storage so `/offload` archives survive restarts, and its address stays stable across restarts because the artifacts root is deterministic per user. This uses the existing `artifacts_root` support on `CompositeBackend` (already consumed by both the filesystem and summarization middleware), so it is a dcode-only change with no SDK edit. The artifacts dir is created `0o700` with an ownership/`S_ISDIR` guard and falls back to a private unique dir if the predictable path is squatted; consolidating on one per-user dir also removes the old unbounded `mkdtemp`-per-session leak. The rubric grader's read allow-list now derives its permitted prefix from `artifacts_root` rather than a hardcoded `/large_tool_results/`. Made by [Open SWE](https://openswe.vercel.app/agents/e815e778-3188-4f2e-1068-e52819c024a7) ## References - Plan: https://openswe.vercel.app/agents/e815e778-3188-4f2e-1068-e52819c024a7/plan --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
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`. The published GitHub release body is extracted from the merged `CHANGELOG.md` by `release.yml`, not from this PR description._ --- ## [0.1.40](langchain-ai/deepagents@deepagents-code==0.1.39...deepagents-code==0.1.40) (2026-07-16) ### Features - Added plugin marketplace support ([langchain-ai#4554](langchain-ai#4554)). - Added an “always allow” option to the project MCP approval prompt ([langchain-ai#4562](langchain-ai#4562)). - Improved `/goal` workflows: criteria generation now runs server-side, YOLO mode auto-accepts criteria, goals complete after satisfied grading, and goal review editing now supports `Ctrl+X` ([langchain-ai#4754](langchain-ai#4754), [langchain-ai#4784](langchain-ai#4784), [langchain-ai#4781](langchain-ai#4781), [langchain-ai#4780](langchain-ai#4780)). - Reasoning effort now persists across restarts ([langchain-ai#4728](langchain-ai#4728)). - Added a toast prompting you to re-paste when a chat paste collapses ([langchain-ai#4742](langchain-ai#4742)). ### Bug Fixes - Tool calls awaiting approval are now surfaced correctly ([langchain-ai#4739](langchain-ai#4739)). - Fixed transcript tail hydration when scrolled to the bottom edge ([langchain-ai#4733](langchain-ai#4733)). - Kept chat input responsive during MCP viewer `Ctrl+R` reconnects ([langchain-ai#4753](langchain-ai#4753)). - Improved inline free-text prompts by sharing paste handling and matching primary-input `Ctrl+D` behavior ([langchain-ai#4736](langchain-ai#4736), [langchain-ai#4729](langchain-ai#4729)). - Fixed local offloaded tool results to use the real filesystem ([langchain-ai#4740](langchain-ai#4740)). - Cleaned offloaded history when deleting a thread ([langchain-ai#4751](langchain-ai#4751)). - Removed duplicated content from the system prompt by overwriting the base prompt ([langchain-ai#4516](langchain-ai#4516)). - Closed subprocess transport during install teardown ([langchain-ai#4735](langchain-ai#4735)). - Added targeted `uv` constraints for prerelease dependencies ([langchain-ai#4744](langchain-ai#4744)). _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.
In dcode local mode, offloaded large tool results previously lived behind a virtual
CompositeBackendroute backed by a hiddenmkdtempFilesystemBackend. Becauseexecutealways runs on the default backend (never path-routed), the agent could not open those results withjq/grep/pythonby the path it was handed — the/large_tool_results/prefix wasn't a real inode, and the temp root was intentionally hidden.This points
CompositeBackend.artifacts_rootat a stable, hardened per-user temp dir and drops the/large_tool_results/route, so offloaded results fall through to the defaultLocalShellBackendat a real path. The agent can now inspect them withexecuteusing the exact path the offload message hands it — no virtual-path translation, no copy-out/in. Conversation history keeps a dedicated route to persistent~/.deepagentsstorage so/offloadarchives survive restarts, and its address stays stable across restarts because the artifacts root is deterministic per user.This uses the existing
artifacts_rootsupport onCompositeBackend(already consumed by both the filesystem and summarization middleware), so it is a dcode-only change with no SDK edit. The artifacts dir is created0o700with an ownership/S_ISDIRguard and falls back to a private unique dir if the predictable path is squatted; consolidating on one per-user dir also removes the old unboundedmkdtemp-per-session leak.The rubric grader's read allow-list now derives its permitted prefix from
artifacts_rootrather than a hardcoded/large_tool_results/.Made by Open SWE
References