Skip to content

fix: remove unused MIN_THREADS and CPU_THRESHOLD variables#489

Open
xlyoung wants to merge 1 commit into
strands-agents:mainfrom
xlyoung:fix/remove-unused-thread-pool-variables
Open

fix: remove unused MIN_THREADS and CPU_THRESHOLD variables#489
xlyoung wants to merge 1 commit into
strands-agents:mainfrom
xlyoung:fix/remove-unused-thread-pool-variables

Conversation

@xlyoung
Copy link
Copy Markdown

@xlyoung xlyoung commented Jun 4, 2026

Problem

The workflow tool defines three thread pool configuration variables, but two of them have no effect:

  • MIN_THREADS (STRANDS_WORKFLOW_MIN_THREADS): Stored in self.min_workers but never referenced again. Python's ThreadPoolExecutor doesn't support min_workers — threads are created lazily on demand.
  • CPU_THRESHOLD (STRANDS_WORKFLOW_CPU_THRESHOLD): Defined with comment "CPU usage threshold for scaling down" but never referenced anywhere. No CPU monitoring is implemented.

Only MAX_THREADS actually controls the thread pool size.

Fix

  • Remove MIN_THREADS and CPU_THRESHOLD variables
  • Remove the unused min_workers parameter from TaskExecutor.__init__
  • Clean up the unused self.min_workers attribute

Testing

All 32 existing workflow tests pass with no changes needed.

Fixes #327

Remove MIN_THREADS (STRANDS_WORKFLOW_MIN_THREADS) and CPU_THRESHOLD
(STRANDS_WORKFLOW_CPU_THRESHOLD) variables from workflow.py.

- MIN_THREADS was stored in self.min_workers but never used. Python's
  ThreadPoolExecutor creates threads lazily on demand, so min_workers
  has no effect.
- CPU_THRESHOLD was defined with a comment about scaling down but was
  never referenced anywhere in the codebase. No CPU monitoring was
  implemented.

Also removes the unused min_workers parameter from TaskExecutor.__init__
since it was only passed through to the unused self.min_workers attribute.

Fixes strands-agents#327
@xlyoung xlyoung requested a deployment to manual-approval June 4, 2026 03:19 — with GitHub Actions Waiting
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.

[BUG] Workflow - Title: Thread pool configuration variables MIN_THREADS and CPU_THRESHOLD are defined but not used

1 participant