Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

feat: deprecate sleep, editor, and shell in favor of SDK vended tools - #550

Merged
yonib05 merged 3 commits into
strands-agents:mainfrom
yonib05:feature/deprecate-tools-for-sdk-kb0up
Jul 31, 2026
Merged

yonib05 merged 3 commits into
strands-agents:mainfrom
yonib05:feature/deprecate-tools-for-sdk-kb0up

Conversation

@yonib05

@yonib05 yonib05 commented Jul 29, 2026 •

Copy link
Copy Markdown
Member

Description

The Strands SDK now vends equivalents of sleep, editor, and shell from strands.vended_tools. Maintaining both implementations invites drift, where a fix applied in one place silently does not apply in the other. This adds a deprecation warning to each tool pointing at its SDK replacement, and documents the migration in the README.

Each tool logs a warning on invocation, so users get the signal at the point of use rather than only in release notes. This follows the existing precedent in use_llm.py and agent_graph.py rather than DeprecationWarning, which would break consumers running with -W error.

Tool Replacement Warning Error log
sleep strands.vended_tools.sleep v0.8.6 v0.9.0
editor strands.vended_tools.file_editor v0.8.6 v0.9.0
shell strands.vended_tools.shell v0.8.6 v0.9.0

The tools are not removed. In v0.9.0 the same message is logged at error level instead of warning — a louder signal for anyone who has not migrated, with no behavior change. These tools are the first of an incremental set of deprecations that ends with this repository being archived, so deleting them in 0.9.0 would break users mid-migration and hand them an ImportError with no hint about where the replacement lives. The README states the archive plan so users can decide whether to migrate early.

Scope notes

The replacements are not drop-in equivalents, so the README states the gaps rather than implying a clean swap: the SDK shell is stateless and sandbox-routed with no PTY or command batching; file_editor lacks pattern_replace/find_line/undo_edit; and SDK sleep configures its cap via make_sleep(max_duration=...) instead of MAX_SLEEP_SECONDS.

http_request is deliberately excluded. The SDK version is a thin httpx shim without HTML-to-markdown conversion, so deprecating it now would point users at a replacement that does not cover their use case. It should be revisited once web_fetch (harness-sdk #3375) merges and ships.

Dependency

The shell migration message names strands.vended_tools.shell, which does not exist yet — the SDK tool is currently called bash. That name is inaccurate: it delegates to Sandbox.execute(), which runs sh -c in the Docker and local sandboxes and the remote login shell over SSH, so it invokes whichever shell the sandbox provides rather than bash specifically. A companion PR renaming it to shell is required before this ships in a release. If that rename is rejected or lands under a different name, the message here needs updating first.

Related Issues

Documentation PR

Type of Change

Other (please describe): Deprecation of existing tools superseded by the SDK

Testing

Added three caplog-based tests asserting each tool logs its warning and names the correct replacement. Also verified end-to-end that the warnings fire through the real agent.tool.* path, not just direct function calls:

strands_tools.sleep: DEPRECATION WARNING: sleep is deprecated. This warning becomes an error log in v0.9.0. ...
strands_tools.editor: DEPRECATION WARNING: editor is deprecated. This warning becomes an error log in v0.9.0. ...
strands_tools.shell: DEPRECATION WARNING: shell is deprecated. This warning becomes an error log in v0.9.0. ...

The warning is placed before any early return in each tool, so it fires on every invocation including error paths.

  • I ran hatch run prepare

Result: 1285 passed, 1 failed. The failure is tests/test_agent_core_memory.py::test_initialization, which is pre-existing on main and unrelated to this change (it asserts a hardcoded region against the local AWS_REGION). tests/test_shell.py::test_command_executor_execute_with_pty also terminates the pytest process locally; likewise reproduced on a clean main checkout.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Note on the last two items: this change intentionally adds deprecation warnings, which is its purpose; it introduces no unintended ones. The dependent SDK rename described above is not yet merged.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The Strands SDK now vends equivalents of these tools from
strands.vended_tools. Maintaining both implementations invites drift,
where a fix applied in one place silently does not apply in the other.

Each tool logs a warning on invocation naming its replacement, so users
get the signal at the point of use rather than only in release notes.
Warnings ship in v0.8.6 and the tools are removed in v0.9.0.

http_request is deliberately excluded: the SDK version cannot yet do
HTML-to-markdown conversion, so deprecating it now would point users at
a replacement that does not cover their use case.

Co-Authored-By: Claude <[email protected]>
@yonib05
yonib05 requested a review from a team as a code owner July 29, 2026 14:26
@yonib05
yonib05 requested a review from liramon2 July 29, 2026 14:26
Comment thread src/strands_tools/sleep.py Resolved
mehtarac
mehtarac previously approved these changes Jul 29, 2026
liramon2
liramon2 previously approved these changes Jul 29, 2026
@yonib05

yonib05 commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

Dependency: this PR's shell migration message points at strands.vended_tools.shell, which is introduced by strands-agents/harness-sdk#3574 (renames the sandbox-routed bash tool to shell). That PR should merge and ship before this one is released, otherwise the warning names a symbol that does not exist yet.

These tools are the first of an incremental set of deprecations that ends
with this repository being archived. Deleting them in 0.9.0 would break
users mid-migration and give them an ImportError with no hint about where
the replacement lives.

Instead the tools keep working and the warning becomes an error log in
0.9.0 — a louder signal that still carries the migration path. The README
now states the archive plan so users can weigh migrating early.

Co-Authored-By: Claude <[email protected]>
@yonib05
yonib05 dismissed stale reviews from liramon2 and mehtarac via 5aff9eb July 31, 2026 15:03
@yonib05

yonib05 commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

@mehtarac @liramon2 — heads up that the semantics changed after your approvals, so this is worth a second look.

Before: these tools were deleted in v0.9.0.
Now: they keep working, and the warning is logged at error level in v0.9.0 instead of warning. No behavior change, just a louder signal.

The reasoning: these three are the first of an incremental set of deprecations that ends with this repo being archived. Removing them in 0.9.0 would break users mid-migration and give them an ImportError with no pointer to the replacement. An error log keeps the migration path in front of them while nothing breaks. The README now also states the archive plan, so users can decide whether to migrate early rather than repeatedly.

Changed in 5aff9eb: message wording in all three tools, the README table (Removed → Error log), and their tests. The warning mechanism, insertion points, and capability-gap docs are unchanged from what you already reviewed.

@mehtarac this also answers your timeline question more usefully — since nothing is deleted at 0.9.0, the exact release date stops being a hard deadline for users.

mehtarac
mehtarac previously approved these changes Jul 31, 2026
Comment thread src/strands_tools/editor.py Resolved
Adopts the decorator prescribed by the SDK's FEATURE_LIFECYCLE.md so type
checkers and IDEs flag call sites before anything runs.

Kept alongside the existing log message rather than replacing it. Python's
default warning filter only surfaces DeprecationWarning raised from
__main__, and the agent invokes tools from inside SDK internals, so the
decorator alone produces no output for the users this targets. The
decorator covers static analysis and -W error; the log covers runtime.

Bumps the typing_extensions floor to 4.5.0, which is where the decorator
was introduced.

Co-Authored-By: Claude <[email protected]>
@yonib05
yonib05 enabled auto-merge (squash) July 31, 2026 19:49

This branch was previously deployed

1 inactive deployment
auto-approve — 8cc86bac Deployed Jul 31, 2026 by yonib05 via check-access-and-checkout #530
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants