Conversation
…dError Offline mode now activates when no daemon is running and no API key is set — calls succeed with an audit log entry instead of raising DaemonNotFoundError. Update the e2e test to assert the new behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Claude Code ReviewCode Review: Node9 Python SDK PR🚨 Critical Issues1. Merge conflict in README.md 2. 3. 4.
|
🤖 Claude Code ReviewCode Review: Node9 Python SDK PR🚨 Critical Issues1. Merge conflict in README.md 2. 3. 4. 5. _config.AGENT_NAME = agent_name
_config.AGENT_POLICY = policyIn async agent frameworks (LangGraph, FastMCP), concurrent requests could race on these globals. A shared agent running multiple sessions simultaneously could have incorrect policy applied to a call.
|
- Resolve README.md merge conflict - NODE9_SKIP=1 now emits a warning and writes an audit entry (no silent bypass) - configure() is now thread-safe via threading.Lock - DLP scan covers all string args, not just params named filename/content - _dispatch() renamed to dispatch() — public API should not have underscore (_dispatch kept as deprecated alias with DeprecationWarning) - workspace validated at __init__ time with clear error if path doesn't exist - @internal docstring clarifies it logs to stdout, not to audit trail - README: shell=True examples now include sanitization warning - README: _dispatch references updated to dispatch()
🤖 Claude Code ReviewCode Review: Node9 Python SDK v2.0.0Critical Security Issues1. 2. NODE9_SKIP=1Any process with env access can silently disable all governance. There's no audit log entry when 3. Path traversal check only fires if if hasattr(self, "_workspace") and self._workspace:If 4. DLP path_arg = call_args.get("filename") or call_args.get("path") or ""This only checks two parameter names. A method named 5. Correctness / Edge Cases6. 7. def tool(tool_name: str | Callable):
8. 9. No timeout on API Design10. def write_code(self, filename: str, content: str) -> str:
with open(filename, "w") as f: # raw open — not workspace-relativeThe path safety check validates 11. Test Coverage Gaps
Minor
Automated review by Claude Sonnet |
- DLP now checks every string arg as a path candidate, not just params named filename/path — fixes silent bypass on dest/target/output params - tool() annotation uses Union[str, Callable] instead of str | Callable — fixes TypeError on Python 3.9 - Docstring examples: shell=False + shlex.split(), write_code uses safe_path - dispatch referenced consistently (not _dispatch) in all docstrings - Node9Agent.new_session() added for server deployments with multiple users - __all__ documents build_tools_anthropic/openai/dispatch/new_session
🤖 Claude Code ReviewCode Review: Node9 Python SDK v2.0.0Security Issues (Critical)1. # _client.py (implied by README)
if os.environ.get("NODE9_SKIP"):
return # auto-approveAny code running in the same process can set 2. DLP scan on 3. 4. Correctness / Edge Cases5. 6. 7. 8. API Design9. 10. 11. Test Coverage Gaps12. 13. No test for cloud routing fallback ordering Minor
Automated review by Claude Sonnet |
🤖 Claude Code ReviewNode9 Python SDK — Code ReviewSecurity Issues (High Priority)1. 2. 3. 4. dlp_scan("/home/user/.ssh/id_rsa", "content")This is fine as a smoke test, but if DLP matching is prefix/substring-based on the full path string, a relative path like 5. README — Correctness and Edge Cases6. 7. 8. 9. API Design10. 11. 12. Version bump to 2.0.0 without a CHANGELOG entry Test Coverage Gaps
Minor
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDK PRSecurity Issues (Critical)
Correctness and Edge Cases
API Design
Test Coverage Gaps
MinorThe version jump from The
Automated review by Claude Sonnet |
…ning, 13 new tests - safe_path(filename, *, workspace=...) — workspace is now keyword-only to prevent silent positional arg swaps; all call sites updated - NODE9_SKIP=1 now warns at import time (not just per-call) so it's harder to accidentally leave enabled in production - new_session() docstring explicitly documents the one-instance-per-request requirement - 13 new tests: dispatch() unknown tool (returns string, never raises), new_session() UUID validity and concurrent calls, _build_tools() unannotated/int/bool/float params and *args/**kwargs exclusion, safe_path symlink traversal rejection, configure() called twice (second wins) and empty args don't overwrite Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Claude Code ReviewCode Review: Node9 Python SDK PRSecurity Issues (High Priority)1. 2. 3. 4. Correctness and Edge Cases5. 6. 7. Test Coverage Gaps8. No tests for
9. No test for API Design10. 11. Minor
Automated review by Claude Sonnet |
…nv var tests - Path safety now checks ALL path-like args in @tool methods, not just the first; a method with src+dest params now validates both (removed the break) - dispatch() docstring clarifies the lookup is strictly registry-based (@tool marker) - README run_shell example gets explicit warning that shlex.split still allows arbitrary executables — callers must allowlist commands in production - NODE9_SKIP env var table entry strengthened: "Never set in production" - Git hooks now use the active virtualenv Python instead of hardcoded python3 - New tests: traversal in second path arg is caught, configure() wins over env var, env var sets baseline before configure() is called Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Claude Code ReviewCode Review: Node9 Python SDKSecurity Issues (High Priority)
README
Correctness and Edge Cases
API Design
Version bump to Test Coverage Gaps
MinorThe pre-commit and pre-push hooks are functionally identical. Consider a shared script they both source to avoid drift. The
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDK PRSecurity Issues (High Priority)
API Design Issues
Test Coverage Gaps
Daemon / HTTP CommunicationVersion bump to Offline fallback to Minor / Positive Notes
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDKSecurity Issues (Critical)1. 2. 3. 4. Correctness / Edge Cases5. 6. 7. API Design8. 9. 10. Version bump to Test Coverage Gaps
Git HooksThe pre-commit hook uses SummaryThe main concerns in priority order: DLP scope in
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDKSecurity Issues (High Priority)
Correctness & Edge Cases
API Design
Test Coverage Gaps
MinorThe version jump from
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDKSecurity Issues (Critical)1. 2. 3. 4. Correctness & Edge Cases5. 6. 7. 8. Daemon HTTP Communication9. No timeout shown on daemon HTTP calls 10. Offline fallback is auto-approve — this is dangerous and under-documented API Design11. Version jump from 0.1.1 → 2.0.0 without migration guide 12. Test Coverage Gaps
Minor
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDKSecurity Issues (High Priority)
@tool("run_shell")
_ALLOWED_COMMANDS = {"pytest", "ruff check .", "mypy src/"} # ← assignment between decorators
@protect("bash")
def run_shell(command: str) -> str:This is broken Python. The
Correctness Issues
PYVER=$("$PYTHON" -c 'import sys; print(sys.version_info >= (3,10))' 2>/dev/null)
if [[ "$PYVER" != "True" ]]; then
echo "❌ node9: Python 3.10+ required ...The script header says
API Design Issues
Test Coverage Gaps
MinorThe Summary: The
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDKSecurity IssuesCritical:
DLP in Correctness and Edge Cases
Git Hooks
Hook setup is manual API Design
Test Coverage Gaps
MinorThe Overall the security posture improvements (removing
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDKSecurity Issues (High Priority)
Git HooksSourcing
PYTHON="${VIRTUAL_ENV:+$VIRTUAL_ENV/bin/python}"
PYTHON="${PYTHON:-$(command -v python3 2>/dev/null)}"If API Design
Test Coverage Gaps
Minor Issues
What Looks Good
Automated review by Claude Sonnet |
🤖 Claude Code ReviewCode Review: Node9 Python SDKSecurity
Correctness & Edge Cases
Test Coverage Gaps
API Design
Minor
Automated review by Claude Sonnet |
Auto-generated PR
Merge latest
devchanges intomainto trigger a release.