From f845954ad3f57699d17960a48596a92dab3304a2 Mon Sep 17 00:00:00 2001 From: ran Date: Thu, 3 Sep 2026 10:05:34 +0200 Subject: [PATCH] docs(aws-strands): correct the concurrent-run comment on _activeRunsByThread The doc comment on `_activeRunsByThread` claimed Python guarded the per-thread collision only around an orchestrator and that its single-agent path had no guard of its own. That stopped being true once Python grew its own `_active_runs_by_thread` set and refused an overlapping run in `run`. Describe what both bridges do now: each refuses a per-thread collision before entering the run body, with the same code and the same message text, and Python additionally guards a shared orchestrator instance across every thread (narrowing back to per-thread when a callable builds a fresh orchestrator per run) and refuses a run against an orchestrator parked at an interrupt. ARCHITECTURE.md already described this behaviour correctly. Comment only; no runtime string or behaviour changes. --- integrations/aws-strands/typescript/src/agent.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/integrations/aws-strands/typescript/src/agent.ts b/integrations/aws-strands/typescript/src/agent.ts index c9e520a1f7..b3f4a7d416 100644 --- a/integrations/aws-strands/typescript/src/agent.ts +++ b/integrations/aws-strands/typescript/src/agent.ts @@ -2136,9 +2136,12 @@ export class StrandsAgent { * Threads with an in-flight run. Strands `Agent.stream()` throws if a * second invocation is started on a busy agent; we detect the collision * up front and emit a protocol-shaped RUN_ERROR/THREAD_BUSY instead. - * Python guards the same collision with the same code and the same text, - * but only around an orchestrator, and keyed by thread only when a factory - * builds one per run; its single-agent path has no guard of its own. + * Python refuses the same per-thread collision before entering its own run + * body, with the same code and the same message text. It additionally + * guards a shared orchestrator instance across every thread, since such an + * instance cannot be multiplexed at all; that arm narrows back to per-thread + * when a callable builds a fresh orchestrator per run. It also refuses a run + * against an orchestrator parked at an interrupt. */ private readonly _activeRunsByThread = new Set(); /** Outstanding AG-UI interrupt objects per thread, used to validate