Skip to content

Conversation

@Nomadcxx
Copy link
Owner

Summary

Combined production hardening with 4 logical commits covering PRs #19-#23:

Commit 1: V1 Stabilization (PR #19/#20)

  • Tool-loop guard: Fingerprint-based repeat detection prevents infinite tool call cycles
  • Tool-schema-compat: Normalizes tool definitions across SDK/MCP/CLI into consistent function-call format
  • Auth hardening: Better error messages and retry UX
  • CLI entry points: model-discovery and opencode-cursor commands
  • Runtime-interception: Guard integration for provider boundary

Commit 2: Error Classification (PR #21)

  • isRecoverableError() for retry decision logic (network=recoverable, auth/quota/model=fatal)
  • recoverable field on ParsedError interface
  • Debug-level logging for failed NDJSON parse lines
  • Optional errorType on ExecutionResult

Commit 3: Performance Instrumentation (PR #22)

  • RequestPerf class with 5-phase timing: request:start, spawn, first-token, tool-call, request:done
  • Instrumented both Bun and Node.js streaming paths
  • Tool execution duration logging in ToolRouter

Commit 4: Tool Expansion (PR #23)

  • 3 new default tools: mkdir, rm, stat (7 → 10 tools)
  • rm has safety: refuses non-empty directories without force: true
  • stat returns JSON metadata (size, type, permissions, timestamps)

Test plan

  • 115 tests pass across 10 test files (0 failures)
  • New tests: errors (25), perf (6), tool-loop-guard, tool-schema-compat, defaults (6 new)
  • All existing tests updated for 10-tool count
  • Command injection tests still pass for grep/glob

- Add tool-loop-guard with fingerprint-based repeat detection to prevent
  infinite tool call cycles in the provider boundary
- Add tool-schema-compat layer for normalizing tool definitions across
  SDK/MCP/CLI sources into consistent function-call format
- Harden auth flow with better error messages and retry UX
- Add CLI model-discovery entry points
- Update runtime-interception with guard integration
- Strengthen proxy tool-loop with error classification
- Add comprehensive tests for all new modules
- Extend ParsedError with recoverable boolean field
- Add isRecoverableError() for retry decision logic
- Network errors recoverable, auth/quota/model errors fatal
- Unknown errors with timeout/ETIMEDOUT classified as recoverable
- Add debug-level logging for failed NDJSON parse in streaming parser
- Add optional errorType to ExecutionResult for executor awareness
- 25 new unit tests covering all error type classifications
- Add RequestPerf class for lightweight phase timing
- Instrument Bun and Node.js streaming paths with 5 markers:
  request:start, spawn, first-token, tool-call, request:done
- Add tool execution duration logging in ToolRouter
- Timing summary logged at debug level via summarize()
- 6 new unit tests for perf tracker
- Add mkdir tool with recursive parent directory creation
- Add rm tool with force flag for non-empty directory safety
- Add stat tool returning JSON metadata (size, type, perms, timestamps)
- Update all test expectations from 7 to 10 tools
- Add execution tests: mkdir nested dirs, rm file/dir, stat file/dir
@Nomadcxx Nomadcxx merged commit 8eb2e1b into main Feb 10, 2026
0 of 2 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