Repository navigation
fix(agent-server): Playbooks show descriptions for comma-separated allowed-tools — one bad frontmatter field no longer nulls the record (#2850) - #2851
Merged
Conversation
… — one bad frontmatter field no longer nulls the skill record (#2850) The skill scanner fed the raw `allowed-tools` frontmatter value into `SkillInfo.allowed_tools: Optional[List[str]]`. Claude Code's canonical form is the comma-separated string (`allowed-tools: Read, Bash`) — what the agent guide teaches and the marketplace wizards scaffold — so Pydantic rejected the record, the outer `except` caught it, and the fallback re-added the skill with only its directory name. Every such skill rendered "No description available" in the Playbooks tab, the `/` popup and the chat empty state, and the warning re-fired on every `GET /api/skills`. - `normalize_allowed_tools`: both spellings (`Read, Bash(git:*)` and `[Read, 'Bash(git:*)']`) yield the same list. Linear scan splitting on commas at group depth 0, so `Bash(npm run lint, npm test)` stays one entry; quotes are deliberately not tracked (an apostrophe in shell text must not drop the field). Bool / mapping / number / unbalanced group → field skipped. - Every field is normalized on its own (`_field`), so a bad value drops THAT field to None and the rest survive; the outer `except` is a last resort for an unreadable file only. YAML 1.1 scalars (dates, numbers) coerce to text; `argument-hint: [file]` — Claude Code's idiom, a YAML list once parsed — is restored to the bracketed string. - A skipped field is warned once per (file, field, value), then DEBUG. - `path` falls back to the absolute path outside `/home/developer` instead of raising (also what made the scanner untestable under tmp_path). - `allowed_tools` is documented as display metadata only — nothing enforces it. Release note: the fix lives in the AGENT BASE IMAGE. Existing instances see it only after `./scripts/deploy/build-base-image.sh` and an agent recreate (the #2213 trap); the backend and frontend are unchanged. Fixes #2850 Co-Authored-By: Claude Fable 5.1 <[email protected]>
vybe
approved these changes
Sep 16, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
merge-train 2026-09-16: validated at lane C (/validate-pr, /review, /cso --diff), no critical findings. The new test runs the real parser (50 passed). The earlier journey-smoke and verify-non-root failures were an npm propagation race on rolldown 1.2.9, and both re-runs are green. No file overlap with the other members, so it merges individually.
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
allowed-tools: Read, Bashstring at the Pydantic boundary and fell back to a name-only record, so every such skill showed "No description available" in the Playbooks tab, the/popup and the chat empty state, with the warning re-firing on every request.allowed-toolsis now normalized: the comma-separated string and the YAML list yield the sameList[str](includingBash(git:*), andBash(npm run lint, npm test)stays one entry). Absent/empty →null.nulland is warned once per (file, field, value); description, argument hint, automation and user-invocable survive. YAML 1.1 scalars coerce to text;argument-hint: [file](Claude Code's idiom, a YAML list once parsed) is restored to the bracketed string.allowed_toolsis documented in code and in the flow doc as display metadata only — nothing enforces it.Release note — ships in the agent base image
This fix lives in
docker/base-image/agent_server/routers/skills.py. An existing instance sees it only after./scripts/deploy/build-base-image.shand an agent recreate (the #2213 trap). Backend and frontend are unchanged; the guide and marketplace scaffolds keep the string form, which is the Claude Code contract.Changes
docker/base-image/agent_server/routers/skills.py—normalize_allowed_tools(linear depth-0 comma split, groups tracked, quotes deliberately not),FieldSkipped+ per-field_fieldwiring, warn-once ledger_SKIPPED_FIELD_WARNED,_display_pathfallback outside/home/developertests/unit/test_2850_skill_allowed_tools_forms.py— 50 tests: string/list parity, normalizer table, one-bad-field-keeps-the-rest, bracket argument hints, YAML 1.1 scalars, warn-once across scans, truncated log value, unreadable-file last resortdocs/memory/feature-flows/playbooks-tab.md— normalization table, error-handling rows, scanner unit tests, base-image noteReview
/cso --diff-style security audit run on the diff — no findings above the gate. The review's medium (apostrophe in shell text dropped the field under quote tracking) is fixed by not tracking quotes; its lows ([]hint →null, bool list items rejected) are in.Test Plan
cd tests && .venv/bin/pytest unit/test_2850_skill_allowed_tools_forms.py— 50 passedpytest unit/ -k "agent_server or 2850 or skills or safe_yaml"— 355 passed, 1 skippedSKILL.mdusesallowed-tools: Read, Bash— description and argument hint render; container log shows one warning per malformed field, not one per requestFixes #2850
🤖 Generated with Claude Code