fix(ai-gateway): anchor model-slug regex to prevent false positives#56
Merged
Melkeydev merged 1 commit intovercel:mainfrom Apr 14, 2026
Merged
Conversation
The validator rule in skills/ai-gateway/SKILL.md used `\d+-\d+[)'"]`,
which matched any digit-hyphen-digit followed by a closing bracket,
quote, or apostrophe — much broader than the intended error class
(hyphenated model version slugs like "claude-sonnet-4-5").
False positives seen in real usage:
- `(line 13-21):` — matches `13-21)` in markdown line-range references
- `"00000000-0000-0000-0000-000000000000"` — matches `0-0"` in UUIDs
- `"192.168.1.1-2"` — matches `1-2"` in IP ranges
- `"1-2"` — matches `1-2"` in semver pairs
Fix: anchor the pattern on known model-family keywords with `\b` word
boundaries, matching the convention used by other patterns in the same
file (e.g., line 15: `\bvercel\s+env\s+pull\b`).
\b(claude|gpt|gemini|llama|mistral|qwen|deepseek)[a-z0-9-]*-\d+-\d+[a-z0-9-]*\b
Still catches the intended case ("claude-sonnet-4-5",
"openai/gpt-5-4", "anthropic/claude-sonnet-4-5-20250514") while
leaving line ranges, UUIDs, IP ranges, and other incidental
digit-hyphen-digit patterns alone.
generated/skill-manifest.json regenerated via `bun run build:manifest`.
Melkeydev
approved these changes
Apr 14, 2026
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.
Problem
The
Model slug uses hyphensvalidator rule inskills/ai-gateway/SKILL.md(line 22) uses\d+-\d+[)'"]— any digit-hyphen-digit followed by),', or". This is much broader than the intended error class (hyphenated model version slugs like"claude-sonnet-4-5"), producing false-positive errors in agent tooling whenever those characters coincide.Examples triggered in real usage against unrelated docs/code:
(line 13-21):(markdown line-range)13-21)"00000000-0000-0000-..."(UUID string literal)0-0""192.168.1.1-2"(IP range)1-2""1-2"(semver pair)1-2"Fix
Anchor the pattern on known model-family keywords with
\bword boundaries, matching the convention already used by other patterns in the same file (e.g.,bashPatternson line 15:\bvercel\s+env\s+pull\b).Verification
Tested against both intended targets and known false-positive cases:
claude-sonnet-4-5"claude-sonnet-4-5-20250514""anthropic/claude-sonnet-4-5""openai/gpt-5-4"(line 13-21):"00000000-0000-0000-..."claude-sonnet-4.61-2(semver pair)192.168.1.1-2(IP)Files
skills/ai-gateway/SKILL.md— regex changegenerated/skill-manifest.json— regenerated viabun run build:manifest