Skip to content

Commit cdd2fdb

Browse files
charliegilletclaude
andcommitted
fix(nodes): move test path setup to conftest and document rate-limit opt-out
Move sys.path.insert for tool_http_request into conftest.py so all node unit tests share a single path setup entry point. Document the "all-or-nothing" opt-out behavior in services.json rate-limit field descriptions (all three must be 0 to disable). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c173873 commit cdd2fdb

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

nodes/src/nodes/tool_http_request/services.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,19 @@
114114
"http_request.rateLimitPerSecond": {
115115
"type": "number",
116116
"title": "Max requests per second",
117-
"description": "Maximum number of HTTP requests allowed per second. Uses a token-bucket algorithm for smooth enforcement.",
117+
"description": "Maximum number of HTTP requests allowed per second. Uses a token-bucket algorithm for smooth enforcement. Set to 0 to disable (all three rate-limit fields must be 0 to fully opt out).",
118118
"default": 10
119119
},
120120
"http_request.rateLimitPerMinute": {
121121
"type": "number",
122122
"title": "Max requests per minute",
123-
"description": "Maximum number of HTTP requests allowed per minute. Provides a broader throttle beyond the per-second limit.",
123+
"description": "Maximum number of HTTP requests allowed per minute. Provides a broader throttle beyond the per-second limit. Set to 0 to disable (all three rate-limit fields must be 0 to fully opt out).",
124124
"default": 100
125125
},
126126
"http_request.maxConcurrentRequests": {
127127
"type": "number",
128128
"title": "Max concurrent requests",
129-
"description": "Maximum number of HTTP requests that can be in-flight simultaneously.",
129+
"description": "Maximum number of HTTP requests that can be in-flight simultaneously. Set to 0 to disable (all three rate-limit fields must be 0 to fully opt out).",
130130
"default": 5
131131
}
132132
},

nodes/test/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
PROJECT_ROOT = Path(__file__).parent.parent.parent
4141
sys.path.insert(0, str(PROJECT_ROOT / 'dist' / 'server'))
4242

43+
# Add individual node source directories so unit tests can import modules
44+
# without triggering the top-level nodes/__init__.py (which requires the
45+
# engine runtime).
46+
NODES_SRC = Path(__file__).parent.parent / 'src' / 'nodes'
47+
sys.path.insert(0, str(NODES_SRC / 'tool_http_request'))
48+
4349
# Load environment variables
4450
try:
4551
from dotenv import load_dotenv

nodes/test/test_rate_limiter.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,9 @@
1010
import threading
1111
import time
1212

13-
import sys
14-
from pathlib import Path
15-
1613
import pytest
1714

18-
# Add the node source directory to sys.path so we can import the module
19-
# without triggering the top-level nodes/__init__.py (which requires the
20-
# engine runtime).
21-
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'src' / 'nodes' / 'tool_http_request'))
22-
23-
from rate_limiter import RateLimiter, RateLimitError # noqa: E402
15+
from rate_limiter import RateLimiter, RateLimitError
2416

2517

2618
class TestAcquireRelease:

0 commit comments

Comments
 (0)