Skip to content

Bump deepagents to 0.7 and mirror optional backend ops in TemporalBackend - #1873

Open
DABH wants to merge 9 commits into
mainfrom
deepagents-0.7
Open

DABH wants to merge 9 commits into
mainfrom
deepagents-0.7

Conversation

@DABH

@DABH DABH commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

TLDR: temporalio[deepagents] now requires deepagents>=0.7.12,<0.8. deepagents 0.7 decides a backend's optional capabilities (delete, shell execute) from the wrapper's class, so TemporalBackend now mirrors the inner backend at class level instead of answering every op through __getattr__ — including for user subclasses. Everything else in the plugin worked unchanged.

Pins

  • deepagents>=0.7.12,<0.8. 0.7.14 is the latest release but falls inside the repo's two-week exclude-newer window, so 0.7.12 is the newest version the lock can take today.
  • langsmith<0.13 (was <0.9): deepagents 0.7 requires langsmith>=0.11.2. The langsmith contrib passes unchanged on 0.12.1; its two RunTree.patch overrides follow 0.12's exclude_inputs: bool | None = None, and a test pins that a no-argument call forwards None so LangSmith's own default applies.

TemporalBackend

  • delete: deepagents 0.7 made delete optional and gates its delete tool on type(backend).delete is not BackendProtocol.delete. The old __getattr__-based ops made that class-level lookup raise AttributeError, breaking every agent using built-in file tools. The I/O ops are now real class-level methods, and TemporalBackend(inner) picks a subclass that mirrors inner's delete support.
  • execute: deepagents offers its shell tool only to a nominal SandboxBackendProtocol instance (a plain ABC subclass, not a structural Protocol). A wrapped LocalShellBackend therefore silently lost its shell tool. When deepagents reports the inner backend as execution-capable, the mirror class also derives from SandboxBackendProtocol, with execute/aexecute dispatchers and id forwarded; wrappers around filesystem/store backends stay non-sandbox classes.
  • subclasses: class MyBackend(TemporalBackend) gets the same mirroring (generated as a subclass of MyBackend; ops it defines itself are left alone).

Verification

  • tests/contrib/deepagents: 45 passed on deepagents 0.7.12, including new tests for delete/execute mirroring, subclass participation, and aexecute running as a backend_op Activity through a real LocalShellBackend.
  • tests/contrib/langsmith: 88 passed on langsmith 0.12.1.
  • Full lint gate green.

…kend

The deepagents extra now requires deepagents>=0.7.12,<0.8 (0.7.14 exists
but is inside the two-week exclude-newer window). deepagents 0.7 needs
langsmith>=0.11.2, so the langsmith extra allows langsmith<0.13; the
RunTree.patch overrides follow langsmith 0.12's Optional exclude_inputs
so LangSmith's own default applies on every supported version.

deepagents 0.7 made delete an optional protocol op and checks support on
the wrapper's class (type(backend).delete against the protocol default),
which raised AttributeError for TemporalBackend's __getattr__-based ops.
The I/O ops are now real class-level methods, and the wrapper picks a
subclass mirroring the inner backend's delete support, so deepagents
offers the delete tool exactly when the unwrapped backend would.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new LangSmith default-forwarding behavior needs focused regression coverage.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates Deep Agents integration to 0.7 and preserves optional backend capability detection.

Changes:

  • Mirrors delete/adelete support at class level and routes supported operations through Activities.
  • Updates Deep Agents and LangSmith compatibility ranges.
  • Adds backend capability and Activity-routing tests.
File summaries
File Description
temporalio/contrib/deepagents/_tools.py Implements class-level optional operation mirroring.
tests/contrib/deepagents/test_backends.py Tests delete detection and Activity routing.
temporalio/contrib/langsmith/_interceptor.py Preserves LangSmith’s patch-input default.
pyproject.toml Updates optional dependency constraints.
uv.lock Locks updated transitive dependencies.
CHANGELOG.md Documents dependency and backend changes.
Review details
  • Files reviewed: 5/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread temporalio/contrib/langsmith/_interceptor.py
@patbeqo

patbeqo commented Sep 17, 2026

Copy link
Copy Markdown

@codex

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-17T15:11:45.398423Z 6e2c94c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e2c94c622

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread temporalio/contrib/deepagents/_tools.py
Comment thread temporalio/contrib/deepagents/_tools.py
… default

Per review. deepagents decides execution support with a nominal
isinstance check against SandboxBackendProtocol (an ABC subclass, not a
structural Protocol), so no wrapper was ever mistaken for shell-capable;
the real gap ran the other way: a wrapped LocalShellBackend lost its
shell tool. The mirror class now derives from SandboxBackendProtocol only
when deepagents reports the inner backend as execution-capable, with
execute/aexecute dispatchers and id forwarded; plain backends stay
non-sandbox classes. Mirroring also applies to user subclasses of
TemporalBackend (generated as a subclass of theirs; ops they define are
left alone) instead of being skipped. The langsmith RunTree.patch tests
now pin that a no-argument call forwards exclude_inputs=None so
LangSmith's own default applies.
@DABH

DABH commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved by merging the latest main into this branch and pushed in ce3b60d.

@CLAassistant

CLAassistant commented Sep 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@DABH

DABH commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Comment thread temporalio/contrib/deepagents/_tools.py Outdated
Comment thread pyproject.toml Outdated
"""Patch the run to LangSmith, skipping during replay.

``exclude_inputs`` is forwarded untouched so LangSmith's own default
applies (a plain ``False`` before 0.12; the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small correction: the Optional default and LANGSMITH_EXCLUDE_INPUTS_ON_PATCH landed in langsmith 0.11.0, not 0.12 (0.10.9 still has exclude_inputs: bool = False). The commit message had it right. The same 0.12 shows up in the new test_background_io.py comment, so both could say 0.11.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, confirmed against the wheels: 0.10.9 has def patch(self, *, exclude_inputs: bool = False), 0.11.0 has exclude_inputs: Optional[bool] = None plus _exclude_inputs_on_patch() reading LANGSMITH_EXCLUDE_INPUTS_ON_PATCH. Both comments now say 0.11 (d1f1ae4).

Comment thread temporalio/contrib/deepagents/_tools.py Outdated
deepagents gates the execute tool's per-command timeout on
execute_accepts_timeout(type(backend)), which inspects the signature of
the class's execute for a timeout parameter and, unlike the max_count
probe, does not accept **kwargs as a stand-in. The wrapper's dispatchers
were (*args, **kwargs), so a wrapped LocalShellBackend read False and
refused a timeout its unwrapped self accepts.

The optional-op dispatchers built in _wrapper_class_for now carry the
inner method's signature via __signature__, so every signature probe
answers as it does for the inner backend (including a sandbox that does
not take timeout). The wrapper-class cache is keyed by the inner class
as well, and uses dict.setdefault so concurrent workflow threads building
the same key share one class.
deepagents 0.7.0 already has everything the plugin relies on
(SandboxBackendProtocol, supports_execution, execute_accepts_timeout,
_supports_delete, the optional delete/adelete), and the deepagents test
suite passes against it, so the extra allows >=0.7,<0.8 instead of the
0.7.12 that exclude-newer happened to resolve.

The langchain / langchain-core (and dev langchain-anthropic) floors were
carried over from the deepagents 0.6.12 requirements and sat below what
any 0.7.x pulls in; they now match deepagents 0.7.0's own floors
(langchain>=1.3.14, langchain-core>=1.5.0, langchain-anthropic>=1.5.3).
Only the requires-dist metadata in uv.lock changes; resolved versions
are unchanged.
The Optional exclude_inputs default and LANGSMITH_EXCLUDE_INPUTS_ON_PATCH
landed in langsmith 0.11.0 (0.10.9 still has exclude_inputs: bool = False),
not 0.12.
Re-lock uv.lock after the merge so the project metadata carries both
main's google-adk>=2.8.0 pin and this branch's deepagents/langchain
floors. The only resolved-version change against this branch is
google-adk 2.4.0 -> 2.8.0, inherited from main.
@DABH
DABH enabled auto-merge (squash) September 20, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants