Fix AI token tool argument leniency#121
Merged
DavidBabinec merged 2 commits intoJun 30, 2026
Merged
Conversation
… alias The type/spacing scale runners applied the normalized group alias as the group's namingConvention whenever no explicit namingConvention was sent. On an *existing* group matched by its prefix (e.g. a group whose prefix is literally `typography`/`spacing`/`root`), this silently rewrote the prefix to `text`/`space`, renaming every generated `--<prefix>-*` variable and breaking `var(--…)` references in published pages. Gate the alias on `action === 'created'` so it only seeds the prefix on a newly-created group and never mutates a matched one. Add a regression test and update the agent docs to match the new googleFamily-wins font behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
DavidBabinec
approved these changes
Jun 30, 2026
DavidBabinec
left a comment
Contributor
There was a problem hiding this comment.
Approving with two follow-up fixes pushed to the branch:
- Prefix-rename guard — the type/spacing scale runners applied the normalized group alias as
namingConventionon any call without an explicit one, which silently rewrote the prefix of an existing group matched by a literaltypography/spacing/rootprefix (renaming every generated--<prefix>-*variable and breakingvar(--…)references). Now gated onaction === 'created'so it only seeds new groups. Added a regression test. - Docs —
docs/features/agent.mdstill describedgoogleFamily/familyIdas mutually exclusive; updated to the new googleFamily-wins behavior.
The core leniency change is solid and well-tested. bun test (token tools), tsc -b, and eslint on the touched files all pass.
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
googleFamilywhen model-authored font token args include bothgoogleFamilyandfamilyIdtext,typography,space,spacing, androotTests
bun test src/__tests__/agent/tokenTools.test.ts