Repository navigation
Conversation
…_graph, mongodb_memory, use_aws, and stop tools
|
@strandly-the-agent Review this PR. Check whether the behavior differences are accurate or need updating. |
strandly-the-agent
left a comment
There was a problem hiding this comment.
TL;DR: code side is clean and matches the existing deprecation pattern exactly; the README behavior notes are mostly accurate against SDK main, but 5 of the 9 bullets need updating — one points at a server AWS has itself superseded, and four miss or misstate something a migrating user would hit. Inline suggestions on each.
- 🟡
use_aws→ the linked AWS API MCP server is marked superseded by the managed AWS MCP Server; its migration guide dropsREAD_OPERATIONS_ONLY/REQUIRE_MUTATION_CONSENTin favour of IAM. Same link in the table row (README:246) anduse_aws.py:91. - 🟡
stop→ omits the user-visible change: old tool ended withstop_reason == "tool_use"and an empty final message; new one ends with"cancelled"andmessageas the final assistant text. - 🟡
workflow→ sayspause/resumeare lost, but they were never implemented (workflow.py:1176-1180returns "not yet implemented"). - 🟡
file_read→ "documents come back as content blocks" is only true for pdf/doc/docx/xls/xlsx; the olddocumentmode's csv/html/txt/md now return as numbered text. - 🟡
editor→ silent on the consent prompt and.bakbackups going away, and thatstr_replacereplaced all occurrences whileeditreplaces one.
Everything else in the bullets (graph, agent_graph, file_write, mongodb_memory, the table, the Before/After imports) checks out — details below.
✅ Verified (5b5a1aa vs d036ff9; SDK main 0a50a80)
README claims traced to source (accurate):
read: absolute-only +..rejected (vended_tools/_paths.py:15-20),cat -nlines,offset/limit(read/read.py:107-125), sandbox at call time (:126); old modes exactlyfind, view, lines, chunk, search, stats, preview, diff, time_machine, document(file_read.py:283-295).write: absolute-only (write/write.py:72), no prompt/preview anywhere; oldBYPASS_TOOL_CONSENT+ prompt (file_write.py:215,244).BeforeToolCallEventis_Interruptible(hooks/events.py:221), so the hook-interrupt recipe is real.edit: uniqueness enforced, 0 or >1 matches →ValueError(edit/edit.py:73-77).graph: paramstask/nodes/edges(graph/graph.py:162-166), entry points = no incoming edges (:47), cycles rejected (:314-317),make_graph(tools=Choice(..., multiple=True), model=Choice(...), max_nodes, max_edges, max_node_executions, execution_timeout, node_timeout)(:86-101), tools/model default toInherit()(multiagent/spec.py:277-280). Old lifecyclecreate/execute/status/list/delete(strands_tools/graph.py:553-654),entry_points, per-nodemodel_provider/model_settingsall real.workflow:~/.strands/workflows(workflow.py:135),priority(:586-587), ready batch runs in parallel (multiagent/graph.py:839-843).agent_graph: actionscreate/list/stop/message/status(agent_graph.py:113), topologiesstar/mesh/hierarchical(:126).stop:agent.cancel(message, after_current_tools=True),"cancelled", 4096 default,make_stop(max_message_length=)(stop/stop.py:4-6,21,59,97). Old tool setrequest_state["stop_event_loop"], which the SDK still honours with aDeprecationWarning(event_loop.py:1184-1198).mongodb_memory:MemoryStoreprotocolsearch/add,writable(memory/types.py:263-301),add_tool_configdefaultFalse(memory_manager.py:94), tools namedsearch_memory/add_memory,## Custom Storesanchor exists (managing-memory.mdx:376). Old actionsrecord/retrieve/list/get/delete.- AWS API MCP README:
call_aws,suggest_aws_commands, both env vars default"false", consent via elicitation — accurate for that server; but its README line 4 says it is superseded, andMIGRATION.md:103-104mapsREAD_OPERATIONS_ONLY→ IAM / proxy--read-only,REQUIRE_MUTATION_CONSENT→ "Not needed — use IAM policies". from strands.vended_tools import edit, read, shell, sleep, write, graph, stopimports in a fresh venv off SDK main. Latest tag isv0.8.11, sov0.8.12is right.
Code/tests (independent reviewer pass):
- Pattern matches
batch.py/shell.pyprecedent byte-for-byte (literal@deprecatedmessage + 5-line comment;@tooloutermost for the 4@tooltools, bare@deprecatedfor the 5 TOOL_SPEC tools;MongoDBMemoryToolmirrorsElasticsearchMemoryTool). pytest tests/test_{agent_graph,editor,file_read,file_write,graph,mongodb_memory,stop,use_aws,workflow}.py→ 273 passed.tests/test_deprecations.py→ 300 passed / 4 skipped / 7 failed: the 6 known unreleased-SDKtest_migration_import_resolvescases +a2a_client, which also fails on base (missinga2aextra in the venv).ruff check/ruff format --checkclean.mypy --enable-error-code deprecatedreports all 10 new markers (incl. the@tool-wrapped ones). Five TOOL_SPEC tools still register inToolRegistryafter wrapping; invokingstoplogs the warning and returnssuccess.- README
⚠️markers, Deprecations rows andDEPRECATED_TOOLScross-checked programmatically: consistent.
Questions (non-blocking)
- Should
use_aws's_DEPRECATION_MESSAGEand table row point at the managed AWS MCP Server (with the migration guide) rather than the superseded self-hosted one? I verified the successor docs andMIGRATION.mdresolve, but did not test Strands'MCPClientagainstmcp-proxy-for-awsend to end — worth a quick check before committing to that wording.
Reading order
- README
#### Behavior differencesnew bullets (411-444) and the editededitorbullet (271-273) — the substance. - One
@tooltool (graph.py:415-416) and one TOOL_SPEC tool (stop.py:67-71) — the rest are copies of the pattern. tests/test_deprecations.pyDEPRECATED_TOOLSadditions.
Appendix — non-blocking (7)
- ⚪
stopbullet: "sibling tool calls in the same batch still run" was also true of the old tool (flag checked after the batch,event_loop.py:1184); reads as a change when it isn't. - ⚪
file_readbullet:~is no longer expanded (oldexpanduser,file_read.py:241;readrejects as non-absolute). - ⚪
editorbullet:viewof a directory (tree listing,editor.py:514-516) has noreadequivalent —shellcovers it. - ⚪
graphbullet: old tool already auto-detectedentry_pointswhen omitted (strands_tools/graph.py:468), so "go away" is a smaller change than it reads; edge keys changefrom/to→from_node/to_node. - ⚪
file_writebullet: a link to the Interrupts page would help — "raise an interrupt from a hook" compresses a multi-step recipe. - ⚪
agent_graph.py:532: thelogger.warningsits 10 lines into the body (edited in place) rather than first-after-docstring like every other tool here; no behavioural difference. - ⚪
tests/test_mongodb_memory.py:895:target.__deprecated__lacks thegetattr(..., None)/is not Noneguard thetest_elasticsearch_memory.py:88-91original has — a missing marker would surface asAttributeError, not an assertion.
52ec484 to
c5ce50a
Compare
|
@strandly-the-agent Review this PR. |
strandly-the-agent
left a comment
There was a problem hiding this comment.
TL;DR: approve. All five README findings from my first review are fixed in c5ce50a, the two code nits too, and with strands-agents 1.63.0 now on PyPI (released 19:53Z today) the previously-failing test_migration_import_resolves cases pass — the full touched suite is green.
Status of previous findings:
use_aws→ fixed (bullet, table row,_DEPRECATION_MESSAGE, test all point at the managed AWS MCP Server;aws___call_aws/--read-onlymatch MIGRATION.md).stop→ fixed ("tool_use"→"cancelled", message as final text,request_statenote).workflow→ fixed (pause/resume gone;status+ re-startnamed as the real loss).editor→ fixed (unique vs replace-all, no prompt/.bak, directory views →shell). One grammar slip inline.file_read→ fixed-but-trimmed: "binary documents" is now correct, but the clause saying csv/html/txt/md come back as numbered text was dropped — that was the trap. ⚪ suggestion inline.- Nits:
agent_graph.pywarning moved first, mongodb marker guard added,from_node/to_nodeand the Interrupts link added.
✅ Verified (c5ce50a; strands-agents 1.63.0)
strands-agents==1.63.0on PyPI:from strands.vended_tools import edit, read, write, graph, stop, make_stop, make_graphimports in a fresh venv, so the>=1.63.0floor inpyproject.toml:154is satisfiable.pytest tests/test_{deprecations,agent_graph,mongodb_memory,use_aws,stop,graph,workflow,file_read,file_write,editor}.pywith 1.63.0 → 580 passed, 4 skipped, 0 failed (incl. alltest_migration_import_resolves).ruff check/ruff format --checkclean.- Re-read every edited bullet (README:271-274, 412-440) against the sources cited in my first review; no new inaccuracies introduced. Interrupts
#hooksanchor exists (site/.../sdk/interrupts.mdx:21).
Appendix — non-blocking (2)
- ⚪ PR description still says
read/write/edit/graphare unreleased and lists 6 expected failures; 1.63.0 shipped, so that paragraph and the unchecked "dependent changes published" box are stale. - ⚪
stopbullet dropped themake_stop(max_message_length=...)pointer when it was rewritten; "capped at 4096 by default" now has no "how to raise it". Optional.
c5ce50a to
c94cb14
Compare
Description
Deprecates nine tools in favor of their migration paths. Each tool logs a deprecation warning when invoked and carries a
@deprecatedmarker for type checkers and IDEs, following the existing pattern.file_readfrom strands.vended_tools import readfile_writefrom strands.vended_tools import writeeditorfrom strands.vended_tools import edit, read, write(previously pointed atfile_editor, which the SDK now deprecates)graph,workflow,agent_graphfrom strands.vended_tools import graphstopfrom strands.vended_tools import stopuse_awsmongodb_memory(mongodb_memory,MongoDBMemoryTool)MemoryStoreoverpymongosrc/strands_tools/*:_DEPRECATION_MESSAGE,@deprecatedmarker, and runtimelogger.warning;MongoDBMemoryToolusescategory=Noneso construction does not warn.agent_graph's ad-hoc warning now uses the shared message.src/strands_tools/__init__.py:TYPE_CHECKINGre-exports for the new deprecations.README.md: tool table markers, Deprecations table rows (warning in v0.8.12), behavior notes per tool, and the Before/After example now usesedit, read, write.tests/*: new entries inDEPRECATED_TOOLS, plus per-tool warning and marker tests.Related Issues
N/A
Documentation PR
N/A
Type of Change
Other (please describe): deprecation
Testing
hatch fmt --checkpasseshatch test: 1767 passed, 25 skipped, 6 failed (thetest_migration_import_resolvescases above, which need the unreleased SDK)test_migration_import_resolvesagainst SDKmainsource: 56 passedChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.