Skip to content

fix(openspec): handle reqstool mcp spawn/exit failures in McpStdioClient - #34

Merged
jimisola merged 3 commits into
mainfrom
fix/openspecui-hooks-mcp-robustness
Aug 5, 2026
Merged

fix(openspec): handle reqstool mcp spawn/exit failures in McpStdioClient#34
jimisola merged 3 commits into
mainfrom
fix/openspecui-hooks-mcp-robustness

Conversation

@jimisola

@jimisola jimisola commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

  • McpStdioClient now wires proc.on('error'/'exit') to reject all pending JSON-RPC promises (including the constructor's ready promise), instead of hanging forever if reqstool mcp fails to spawn or exits unexpectedly.
  • enrich() now validates the enrich_document response shape before indexing, throwing a clear error instead of an opaque TypeError.
  • ChildProcess is now imported with import type (it is only used as a type annotation), and both child_process imports use the node: prefix. Style/emit cleanup for consumers building with verbatimModuleSyntaxChildProcess is a genuine runtime export of child_process, so the previous form was not a runtime hazard.
  • Bumped @reqstool-openspec-hooks template version 0.1.1 → 0.1.3, reqstool-openspec plugin version 0.2.1 → 0.2.3, marketplace version 0.5.0 → 0.5.2, per CLAUDE.md versioning rules.

Closes #33. Found during code review of reqstool-python-poetry-plugin#131 (org-wide OpenSpec/reqstool dogfooding rollout) — filed and fixed here rather than patched downstream, since the file is copied verbatim from this template.

Test plan

  • Manual smoke test: load plugins/reqstool-openspec locally and confirm onReadDocument surfaces a warning diagnostic (rather than hanging) when reqstool is not on PATH.
  • bash .github/scripts/check-skill-reference-docs.sh passes.
  • claude plugin validate . passes.

jimisola added 3 commits June 22, 2026 09:32
Pending JSON-RPC promises (including the constructor's ready promise)
previously hung forever if the reqstool mcp child process failed to
spawn or exited unexpectedly, instead of rejecting so onReadDocument's
catch block could surface a diagnostic. Also guard enrich()'s response
shape before indexing, for a clearer error on malformed responses.

Closes #33

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…ess import

Import ChildProcess with `import type` since it is only used as a type
annotation, and use the `node:` prefix for the built-in module.

Note: ChildProcess is a genuine runtime export of child_process, so the
previous form was not a runtime hazard — this is a style/emit cleanup for
projects using verbatimModuleSyntax.

Bumps template header to 0.1.3, plugin to 0.2.3, marketplace to 0.5.2.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
@jimisola
jimisola merged commit 968d5c7 into main Aug 5, 2026
4 checks passed
@jimisola
jimisola deleted the fix/openspecui-hooks-mcp-robustness branch August 5, 2026 10:52
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.

openspecui.hooks.ts: McpStdioClient hangs on reqstool mcp spawn/exit failure

1 participant