Skip to content

fix: support deepagents 0.7 and fix async edit error mapping - #12

Merged
OndrejDrapalik merged 2 commits into
mainfrom
drew/int-236-deepagents-07
Nov 14, 2026
Merged

OndrejDrapalik merged 2 commits into
mainfrom
drew/int-236-deepagents-07

Conversation

@OndrejDrapalik

@OndrejDrapalik OndrejDrapalik commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Adds Deep Agents 0.7 support. Fixes INT-236.

Closes #9

What changed

  • Pin widened to deepagents>=0.6.0,<0.8.0. Before, pip install deepagents langchain-e2b quietly downgraded deepagents to 0.6.x, uv refused to resolve, and deepagents-code 0.2.x (pins deepagents==0.7.38) could not be installed next to langchain-e2b.
  • AsyncE2BSandbox.aedit crashes with AttributeError: '_map_edit_error' is never defined #9, AsyncE2BSandbox.aedit: it called self._map_edit_error, which deepagents moved to module level in 0.6.11. Any async edit whose old_string was missing raised AttributeError and killed agent.ainvoke. It now imports the module function, with a fallback to the BaseSandbox staticmethod for deepagents<0.6.11.
  • AsyncE2BSandbox.aglob: on 0.7 our own parser returned relative paths (0.7's contract is absolute, since relative paths bypass the filesystem deny rules) and raised KeyError: 'path' on 0.7's glob warning records (walk_errors, truncated), so a glob over /etc or with no path failed outright. deepagents 0.6.11+ ships an async-native BaseSandbox.aglob built on aexecute, so aglob now defers to it when present. The old parser stays, unchanged, for 0.6.0 to 0.6.10.

How it was verified

  • Unit tests:
    • make test on the locked deepagents 0.6.10: 68 passed, 3 skipped (the skips are the warning-record cases, which 0.6 never emits).
    • The same suite in separate venvs: 0.6.12, 68 passed and 3 skipped; 0.7.38 (Python 3.14, deepagents-code 0.2.8), 71 passed.
  • The new tests fail against main's code on 0.6.12 (the 2 edit tests) and on 0.7.38 (all 8). They pass on 0.6.10, where neither bug exists.
  • make lint (ruff and ty) passes.
  • Live, against real E2B sandboxes on deepagents 0.7.38:
    • Backend probe of every sync and async method: 0 failures. This covers edit on the inline and upload paths, missing-string edits, glob, and 0.7's new delete/adelete.
    • Async agent with a failing edit: the edit returns a clean tool error, Error: String not found in file: 'Goodbye', and the run continues. On main the whole ainvoke raised.
    • Async agent with glob, grep and read: glob returns ['/home/user/hello.py'], and read_file on that path succeeds.
    • Glob over unreadable directories: aglob("*.conf", "/etc") returns 77 matches with truncated=True, reason=unreadable. On main the same call raises KeyError: 'path'.
  • deepagents-code==0.2.8 and this branch resolve together to deepagents 0.7.38 with no override.

Residual risk

  • CI still runs only the locked deepagents 0.6.10. The test group's deepagents-code>=0.1.19,<0.2.0 pins it there. Moving to dcode 0.2.x would bring in 0.7, but 0.2.x requires Python 3.14 only. 0.7 coverage here comes from the local venv runs and the live runs above.
  • Follow-ups, not in this PR:
    • agrep has no max_count (0.7 trims afterwards, so nothing breaks).
    • aread does not fill total_lines, start_line or next_offset.
    • On deepagents>=0.6.11 the other async overrides (aedit, agrep, aread, and adelete, which still goes through to_thread) could also defer to upstream.
    • Found during review but older than this PR: sandbox.py imports ASYNC_GREP_TIMEOUT, which deepagents 0.6.0 to 0.6.7 do not have, so the real floor is 0.6.8. Also, the awrite docstring says it fails when the file exists, but on 0.7 it overwrites, the same as upstream's write.

Council review

Rounds: 2

Delegate Round 1 Round 2
Claude Fable 5.2 7/10 9/10
GPT-6 Astra 7/10 9/10
Gemini 4 Argon 7.5/10 9.5/10

- widen the deepagents pin to >=0.6.0,<0.8.0
- AsyncE2BSandbox.aedit: call deepagents' module-level _map_edit_error
  (moved off BaseSandbox in 0.6.11), falling back to the staticmethod on
  older 0.6.x
- AsyncE2BSandbox.aglob: defer to the async-native BaseSandbox.aglob
  (deepagents>=0.6.11), which returns absolute paths and handles 0.7's
  glob warning records instead of raising KeyError: 'path'

Refs INT-236. Closes #9.
@cla-bot cla-bot Bot added the cla-signed label Nov 14, 2026
@linear-code

linear-code Bot commented Nov 14, 2026

Copy link
Copy Markdown

INT-236

@OndrejDrapalik
OndrejDrapalik merged commit 7798433 into main Nov 14, 2026
10 checks passed
@OndrejDrapalik
OndrejDrapalik deleted the drew/int-236-deepagents-07 branch November 14, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AsyncE2BSandbox.aedit crashes with AttributeError: '_map_edit_error' is never defined

1 participant