fix(skill): make interface-body parsing comment- and string-aware#135
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 9, 2026 15:32
INTERFACE_REGEX used a [^}]*-bounded match, so a nested object-type property truncated the interface body at the first closing brace (#124). parse_parameters processed the body line by line, so a property declaration wrapping onto a second line was silently dropped (#125). Replace both with a single comment- and string-literal-aware scan: extract_interface_body tracks brace depth only in Code state, and split_top_level_properties splits on top-level semicolons, both skipping over comment and string-literal content. This also fixes two gaps found in review: a multi-member nested object type being dropped because the property regex could not span an internal `;`, and a brace inside a comment corrupting brace-depth tracking for the whole interface. Closes #124, #125
bug-ops
force-pushed
the
124-125-skill-parser
branch
from
July 9, 2026 15:34
fe1c2d0 to
ca56fc5
Compare
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
[^}]*-boundedINTERFACE_REGEXwith a balanced-brace, comment- and string-literal-aware scan (extract_interface_body) so a nested object-type property no longer truncates the rest of the interface body (mcp-skill parser: INTERFACE_REGEX truncates interface bodies with nested-type braces #124).split_top_level_properties, which splits on top-level;instead of newlines, so a property declaration whose type wraps onto a second line is captured and parsed correctly (mcp-skill parser: parse_parameters does not support multi-line property declarations #125).filter: { foo: string; bar: number; }) being dropped because the property regex couldn't span an internal;, and a brace inside a////* */comment corrupting brace-depth tracking and dropping every parameter for the tool.[Unreleased] > Fixed.Closes #124, closes #125.
Test plan
cargo +nightly fmt --checkcargo +stable clippy --all-targets --all-features --workspace -- -D warningscargo nextest run --all-features --workspace --no-fail-fast(693/693 passed)cargo test --doc --all-features --workspaceRUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace