Skip to content

fix: round 2 stress test — deadlocks, race conditions, repo cleanup#6

Merged
msilverblatt merged 7 commits intomasterfrom
fix/round2-stress-test
Mar 15, 2026
Merged

fix: round 2 stress test — deadlocks, race conditions, repo cleanup#6
msilverblatt merged 7 commits intomasterfrom
fix/round2-stress-test

Conversation

@msilverblatt
Copy link
Owner

Summary

Second pass of stress testing. Fixes deadlocks, race conditions, and cross-SDK consistency issues found in round 2. Also cleans up repo presentation.

Code fixes

Commit Scope What
fix(process) Go runtime Lock m.streams map access in readLoop — data race causing potential panic
fix(typescript) SDK Workflow deadlock (toolManager.setAllowed in single-threaded runner), hidden tool disable, first-tool-call sidecar guard
fix(python) SDK URI template matching for resources (was blindly using first template), clear all registries on hot reload
fix(go) SDK Add hidden tool disable after handshake + HiddenHint() option
fix(rust) SDK Double-lock deadlock in handle_call_tool — changed handler from Box to Arc so it can be cloned out of registry lock

Repo cleanup

  • Add MIT LICENSE file (was referenced in badge but missing)
  • Add SDK install instructions to README Quick Start (pip/npm/go get)
  • Add performance overhead note
  • Create sdk/typescript/README.md for npm
  • Remove 13 .pyc files from git tracking
  • Remove internal planning docs from public repo
  • Fix workflow example run command

Test plan

  • go test ./cmd/... ./internal/... — all pass
  • go test ./test/e2e/... — all pass
  • Python SDK — 149/149 pass
  • TypeScript SDK — 102/102 pass
  • Rust SDK — 73/73 pass (parallel)
  • git ls-files '*.pyc' — returns nothing
  • ls LICENSE — exists

The stream reassembly map was accessed in readLoop without holding m.mu,
causing potential "concurrent map read and map write" panics when
CallToolStream runs concurrently.
…car guard

- Replace toolManager.setAllowed() calls in workflow with ToolResult
  enable/disable lists to prevent deadlock in single-threaded runner
- Add hidden tool disable after handshake (matching Python SDK)
- Add first-tool-call flag to prevent starting sidecars on every call
… hot reload

- Resource template handler now matches URI against template pattern
  instead of blindly using the first template
- Hot reload discovery clears all registries (tool, group, workflow,
  context, local_middleware) instead of only groups
Add sendDisableHiddenTools() and HiddenHint() option, matching
the Python SDK's behavior of disabling hidden tools after
the list_tools handshake.
Changed ToolDef handler from Box<dyn Fn> to Arc<dyn Fn> so the
handler can be cloned out of the registry lock and called outside
it. Previously, the handler closure called with_registry() while
the registry Mutex was already held, causing instant deadlock.
- Add MIT LICENSE file (was referenced but missing)
- Add SDK install instructions to README Quick Start
- Add performance overhead note (~0.5ms per call)
- Fix multi-language claim to accurately describe cross-lang API parity
- Create sdk/typescript/README.md for npm package page
- Fix workflow example run command
- Remove .pyc files from tracking
- Remove internal planning docs from public repo
The previous commit removed the toolManager import but left a call
to toolManager.getActiveTools(), breaking tsc compilation.
@msilverblatt msilverblatt merged commit 73b7cb6 into master Mar 15, 2026
8 checks passed
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.

1 participant