fix(openspec): handle reqstool mcp spawn/exit failures in McpStdioClient - #34
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
McpStdioClientnow wiresproc.on('error'/'exit')to reject all pending JSON-RPC promises (including the constructor'sreadypromise), instead of hanging forever ifreqstool mcpfails to spawn or exits unexpectedly.enrich()now validates theenrich_documentresponse shape before indexing, throwing a clear error instead of an opaqueTypeError.ChildProcessis now imported withimport type(it is only used as a type annotation), and bothchild_processimports use thenode:prefix. Style/emit cleanup for consumers building withverbatimModuleSyntax—ChildProcessis a genuine runtime export ofchild_process, so the previous form was not a runtime hazard.@reqstool-openspec-hookstemplate version 0.1.1 → 0.1.3,reqstool-openspecplugin 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
plugins/reqstool-openspeclocally and confirmonReadDocumentsurfaces a warning diagnostic (rather than hanging) whenreqstoolis not onPATH.bash .github/scripts/check-skill-reference-docs.shpasses.claude plugin validate .passes.