[P1 items] Python & TypeScript SDK Parity tracking issue
This issue serves to track parity items which have been triaged as non-P0 features
Python ↔ TypeScript parity — gap analysis (for tracking)
⚠️ Source & caveat: the following was derived from an automated agent analysis of the two SDK trees (
strands-py/andstrands-ts/) and their reference docs. It has not been hand-verified — treat every line as a lead to confirm against current code before acting, not as ground truth. Line/behavior claims may be stale or wrong.
Framing: TypeScript is the newer interface — a number of things learned in Python were applied differently in TS on purpose. We can't break Python, so feature parity is the goal where it makes sense, but some differences are deliberate and should be left alone. Split accordingly:
Close — TS is missing (port Python → TS)
- Tool registry + filesystem loader + hot-reload (
ToolWatcher) — TS has no local tool registry/loader/watcher (only MCPonToolsChanged). - Sliding-window tool-pair trim fallback (
_find_tool_pair_trim_point) — no TS equivalent. - Concurrency/idempotency dedup + result replay (owner-aware lock) — TS has only a boolean
acquireLock(). Partly tracked by #3018. - Summarizing-via-sub-agent path;
per_turnproactive management. - Swarm repetitive-handoff detection.
Close — Python is missing (port TS → Python)
- Backoff/jitter strategy library.
ExecuteToolStage+AgentStreamStagemiddleware + middleware interrupt path (Python only wraps the model call viaInvokeModelStage).LifecycleObserverextension point.- Richer tool-result truncation (typed placeholders, document-source-aware).
- MCP elicitation as a first-class client feature.
- Snapshot-based session model (UUID-v7 immutable history).
- Vended tools:
http-request,notebook. - First-class logging module.
Leave alone — deliberate divergence, NOT parity work
- Model-provider breadth (Python ships ~12 native providers; TS ships ~6 + the Vercel adapter). Explicitly not porting providers.
- Vercel AI SDK adapter.
- Graph/Swarm join semantics (OR/AND-join, batches vs per-node scheduling, tool-based vs structured-output handoff).
- Schema philosophy: Pydantic (Py) vs Zod (TS).
- Python sync↔async bridge (
run_async) — required by Python's sync entrypoint; N/A in TS. - TS Data-interface/companion-class type pattern.
- TS browser-first packaging.
Already tracked separately
- Durable execution / checkpoint parity: #3040 (+ sub-issues #3047–#3051), under epic #2510.
Next step: an owner should confirm each "close" item against current code and convert the confirmed ones into checklist entries / linked issues here.
@pgrayy but really strandly port
@strandly-the-agent can you review this ticket? Then review each SDK in Python and TypeScript for differences that we should include in this task.
Parity re-verification (July 9) — the July 1 auto-analysis is now partly stale
TL;DR: I re-checked every "close" item in the July 1 gap analysis against current code (strands-py/ vs strands-ts/), plus swept both trees for new gaps. The SDKs have converged since then — TS gained registry/, retry/, middleware/, logging/, and context-manager/. Net result: 3 listed items are wrong/no-longer-gaps, 3 narrowed, the rest confirmed, and I found ~15 differences not on the list. Corrected breakdown below — still agent-produced, so confirm before converting to checklist items, but this time every claim is grounded in a file:line I read.
⚠️ Corrections to the existing list (these changed)
- MCP elicitation — NOT a gap, remove it. Python has it:
elicitation_callbackparam + server-32042handling (strands-py/.../tools/mcp/mcp_client.py:213,865,941). Present in both SDKs. - "Backoff/jitter library" (Py missing) — half wrong. Python already does exponential backoff (
event_loop/_retry.py:76,initial_delay * 2**attempt). The real TS→Py gap is jitter + a pluggable backoff/retry-strategy library (strands-ts/src/retry/backoff-strategy.ts), not backoff itself. - "TS has no tool registry/loader/watcher" — narrowed. TS now has a real
ToolRegistry(CRUDL,strands-ts/src/registry/tool-registry.ts:7). Remaining Py→TS gap is just the filesystem/directory loader +ToolWatcherhot-reload (strands-py/.../tools/watcher.py:19). - "Richer tool-result truncation" (Py missing) — narrowed. Python does truncate (image placeholder + text). The TS-only extras are video / document-source-aware / json placeholders (
strands-ts/.../sliding-window-conversation-manager.ts:54,67,80). LifecycleObserver— minor. Python has the functional equivalent viaHookProvider.register_hooks(hooks/registry.py:113); only the named agent-scopedobserveAgent(agent)hook is TS-only.per_turn— nuance. The message-countper_turnmode is Py-only, but proactive compression (token-ratio threshold) exists in both — reviewers shouldn't conflate them.
Confirmed as-listed: _find_tool_pair_trim_point (Py→TS), summarizing-via-sub-agent (Py→TS), concurrency dedup/replay owner-aware lock vs bare acquireLock() (Py→TS, partly #3018), swarm repetitive-handoff detection (Py→TS), middleware ExecuteToolStage/AgentStreamStage+interrupt (TS→Py), snapshot/UUID-v7 session (TS→Py), vended http-request+notebook (TS→Py), first-class logging/ module (TS→Py).
New differences not on the list (grounded in file:line)
Py → TS (missing in TS):
experimental/bidi/— bidirectional / realtime streaming. Biggest gap:BidiAgent+ Nova Sonic / OpenAI Realtime / Gemini Live providers (strands-py/.../experimental/bidi/). No TS equivalent.experimental/checkpoint/— durable-execution checkpoints (Checkpoint,CheckpointPosition). Relates to epic #2510 / #3040.- MCP tool filtering + name-prefixing —
ToolFilters(allowed/excluded/regex/callback) +prefix(mcp_client.py:75,109). No TS option. ToolProviderlifecycle interface (tools/tool_provider.py:11) — no TS analog.- Pluggable tool-executor class hierarchy — Py
ToolExecutor(ABC)is subclassable (tools/executors/_executor.py:32); TS is a fixed'sequential'|'concurrent'enum. - Max-tokens partial-message recovery —
recover_message_on_max_tokens_reachedsanitizes truncatedtool_useblocks (event_loop/_recover_message_on_max_tokens_reached.py:16); TS just throwsMaxTokensError. - Concurrency modes —
THROW/UNSAFE_REENTRANT(agent/_concurrency.py:125); TS has one throw-on-reentry behavior. config_to_agentdeclarative-config factory;handlers/callback handlers (PrintingCallbackHandleretc.); telemetrymetrics_to_string+Tracetimeline class. (handlers/is arguably deliberate — TS uses async-generator streaming instead.)
TS → Py (missing in Python):
- MCP OAuth auth —
auth/authProvider(strands-ts/src/mcp/client.ts:71,113). No Python equivalent. - Pluggable
RetryStrategyabstraction + jitter (see correction above). - Graph
maxConcurrencysemaphore (strands-ts/src/multiagent/graph.ts:52) — Py graph runs each batch fully parallel with no cap. - Cedar
namespaceconfig for namespaced policy types (vended-interventions/cedar/cedar.ts:45) — Py always flattens the schema. Looks accidental / not-yet-ported. warnOncededup utility (part of thelogging/module).
Deliberate divergence — confirmed, leave alone (not parity work)
- Model providers: Py ships 12 native classes; TS ships 5 native + the Vercel adapter, which covers LiteLLM/Mistral/Ollama/LlamaCpp/LlamaAPI/SageMaker/Writer via
@ai-sdk/provider. Confirmed intentional. - Graph/Swarm semantics: Py = OR-join + batch scheduling + tool-based handoff; TS = AND-join + per-node scheduling + structured-output handoff. Documented as intentional in the TS headers (
graph.ts:105,swarm.ts:109). - Steering placement: Py ships it as a
Plugin(plugins:); TS ships it as anInterventionHandler(interventions:). Action vocab also differs (PyProceed|Guide|Interruptvs TSProceed|Guide|Confirm). - Callback-handler pattern (Py) vs async-generator streaming (TS); Pydantic vs Zod;
run_asyncsync↔async bridge; TS data-interface/companion-class pattern; TS browser-first packaging. All as previously noted.
Already tracked elsewhere
Durable execution / checkpoint parity → #3040 (+ #3047–#3051) under epic #2510. Both the TS→Py snapshot/UUID-v7 session model and the Py→TS experimental/checkpoint/ item above sit in this space and should be reconciled against that epic rather than tracked twice.
Happy to open individual issues for the confirmed "close" items or draft checklist entries here — say the word and point me at which direction you want prioritized.
@strandly-the-agent Can you create individual issues using the Port template and link them to this parent issue?
Be sure you include as much detail on what needs to be migrated as possible and complete the port template as detailed as possible
Port issues from the parity audit — both directions
Each issue is filled to the Port template (Source/Target/Related Files/Confirmation) plus detailed what-to-migrate, landing points, and open questions. Every source feature is verified merged + unit-tested (integ/docs status called out per-issue).
TS → Py (“Python is missing”) — 9 issues
- [ ] #3150 — Middleware pipeline:
ExecuteToolStage+AgentStreamStage+ interrupt path (large; deep interrupt-infra work) - [ ] #3151 — Pluggable retry/backoff-strategy library with jitter (back-compat: ms-vs-seconds, abstract-vs-concrete rename)
- [ ] #3152 — First-class logging module +
warn_once(needs a design decision — injectable-global vs Python idiom) - [ ] #3154 — Vended tool:
http_request(clean; needshttpxdep) - [ ] #3153 — Vended tool:
notebook(clean; pure stdlib) - [ ] #3155 — MCP client OAuth authentication (blocker: no client_credentials provider in Python
mcp) - [ ] #3156 — Graph
max_concurrencycap (port the cap concept only, not the scheduler) - [ ] #3157 — Cedar
namespaceconfiguration (additive; docs already say “Python planned”) - [ ] #3158 — Richer tool-result truncation placeholders (type-system blockers: no
video/text-document in Py types)
Py → TS (“TypeScript is missing”) — 9 issues + 1 epic (now that the template supports this direction 🙌)
- [ ] #3163 — Tool filesystem loader + directory discovery + hot-reload watcher (Node-only; ES-module-cache hot-reload gap)
- [ ] #3161 — MCP tool filtering + name-prefixing (regex anchoring trap:
re.matchvsRegExp.test) - [ ] #3162 —
ToolProviderlifecycle interface (needs a new agent dispose/cleanup API; doc gap) - [ ] #3166 — Pluggable tool-executor class hierarchy (refactor TS enum → subclassable base)
- [ ] #3165 — Sliding-window tool-pair trim fallback (small, well-scoped)
- [ ] #3164 — Summarizing-via-sub-agent path (blockers:
LocalAgenthas noinvoke(),readonlytoolRegistry) - [ ] #3167 —
per_turnproactive conversation management (no TS conversation-manager session-state mechanism) - [ ] #3168 — Swarm repetitive-handoff detection (decision: soft-FAIL vs throw)
- [ ] #3170 — Max-tokens partial-message recovery (architectural: TS throws in the model layer before history)
- [ ] #3169 — [EPIC] Bidirectional / realtime streaming (
experimental/bidi) — phased plan, not a single port (experimental source; Nova Sonic likely browser-infeasible — needs a go/no-go)
Excluded / deferred (deliberately not filed)
- Already tracked: concurrency modes (
THROW/UNSAFE_REENTRANT) + idempotency dedup/replay → #3018; durable-execution / snapshot session model → epic #2510 / #3040. Not double-tracked. - Deferred (low value): telemetry
metrics_to_string— theTracetimeline class already exists in TS asAgentTrace; only an undocumented pretty-printer is missing, and ms-vs-seconds /None-vs-0differences make it a reimplementation, not a translation. Say the word if you want it. - Deliberate divergences left alone: model-provider breadth/Vercel adapter, Graph/Swarm join semantics, steering placement, callback-handler pattern vs async-generator streaming, Pydantic-vs-Zod,
run_asyncbridge, browser-first packaging. Also skippedLifecycleObserver(Python already has the functional equivalent viaHookProvider) and Pythonhandlers/callback handlers (deliberate — TS streams via async generators).
Label: thanks for creating
port+ updating the template. I still can't apply the label via the API (the guardrail can't resolve label node-ids), so all 19 issues need theportlabel applied manually — sorry for the manual step.
Happy to adjust scope, split/merge any, or kick off the bidi phases 1–3 as individual [PORT] tickets — just point me at what to prioritize.
Filed #3779 as a child of this tracker: [PARITY] Duplicate tool names: Python silently overwrites (hot-reload allowance), TS throws. Verified by running both SDKs at bf275c7 — two same-named @tools in Agent(tools=[a, b]) leave Python with one tool and no warning (second wins, via the supports_hot_reload allowance in tools/registry.py:250), while new Agent({ tools: [a, b] }) throws ToolValidationError in TS (registry/tool-registry.ts:33).
Two things need a maintainer — strandly-the-agent gets FORBIDDEN on addSubIssue and addLabelsToLabelable with both of its credentials:
- Link #3779 as a sub-issue of this issue. It's currently only a cross-reference, so it's absent from this tracker's sub-issue list unlike every other child.
- Apply the missing labels on #3779:
sdk-parity,typescript,to-refine. It already carriesbug,python,area-devx,area-tool— andbugis arguably wrong: this is a parity/design decision with two candidate directions, not a defect.