Repository navigation
skills_manage: drop empty string from kind enum (Gemini 400) - #294
Merged
Merged
Conversation
…ngs) Live error on a max-build deploy talking to Gemini: gemini error 400: GenerateContentRequest.tools[0].function_declarations [15].parameters.properties[kind].enum[0]: cannot be empty Gemini's GenerateContent endpoint validates every tool's JSON schema and refuses any "enum": [...] that contains an empty string. PR #288's skills_manage schema used "" as the sentinel for "knowledge-only skill" (no callable shell / prompt registered), which works on Anthropic / OpenAI / Mistral but trips Gemini's stricter validator on the FIRST tool call -- so any operator who enabled self_improving_skills.self_manage (max-build profile flips it on) AND points at a Gemini model gets a 400 on every chat request. Drop "" from the enum so it's just ["shell","prompt"]. The handler already treats absent / missing `kind` as knowledge-only (the SKILL.md assembler at line ~336 skips writing the `kind:` frontmatter line when GetStr('kind','') returns empty), so this is a schema cleanup, not a behaviour change. The description string now spells out the "omit for knowledge-only" semantic so the model knows the contract from the tool spec without needing to see the prompt section. Audited the rest of src/pkg/ for other "enum":[""...] / enum:['',...] patterns -- none. This was the only one.
4 tasks done
khongten001
pushed a commit
to khongten001/PasClaw
that referenced
this pull request
Jul 13, 2026
The README + docs/changelog.md last entry was 2026-06-13 (FMXExpress#244). Five substantial PRs (FMXExpress#314 FMXExpress#315 FMXExpress#316 FMXExpress#317 FMXExpress#318) and ten more feature PRs between them and that entry shipped without changelog entries. This brings both files current through today. Twenty new entries (newest first, matching the existing style): 2026-06-21 FMXExpress#318 Relay pull-worker provider (queue + provider + /v1/relay/* HTTP) 2026-06-20 FMXExpress#317 pasclaw plan + build PLAN.md pickup + build --goal + cog mode FMXExpress#316 Cloudflare AI Gateway provider catalog rows FMXExpress#315 MCP progressive disclosure + tool_search FMXExpress#314 Stock defaults adopt lean-edit shape; fs_grep split-gate 2026-06-18 FMXExpress#312 Web UI workspace.zip export + import FMXExpress#310 Model-callable cron tool FMXExpress#309 FTS5 snippet window widened 24 -> 60 FMXExpress#307 Windows cmd.exe quoting fix 2026-06-17 FMXExpress#306 cog-build honours profile=security sandbox FMXExpress#304 cog-build default profile = max-build FMXExpress#303 cog-build list[Path] outputs + Secret inputs + -q 2026-06-16 FMXExpress#302 cog-build optional workspace_in FMXExpress#300 pasclaw build cmd + cog-build/ predictor (parent feature) FMXExpress#299 Checkpoints zpaq backend + /redo FMXExpress#298 AGENTS.md + pasclaw init + /init FMXExpress#297 tool_choice force-a-specific-tool form FMXExpress#296 Delphi ExtraEnv injection fix FMXExpress#295 KB native PDF ingest 2026-06-15 FMXExpress#292 pasclaw profile diff + bench Skipped per the changelog's stated convention ("Bug fixes and review follow-ups are in the full git log"): FMXExpress#293 cmd/profile dcc64 fix FMXExpress#294 skills_manage gemini empty-enum fix FMXExpress#301 cmd.build dcc64 fix FMXExpress#311 cron dcc64 fix Files updated identically (the docs/changelog.md note at the top says "This file mirrors the changelog section at the top of the root README.md"): M README.md 20 entries + 20 link refs added M docs/changelog.md same The link-ref block at the bottom of each file gained 20 [#NNN] entries keeping the existing one-per-line / sorted-numerically format.
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
Live error on a max-build deploy talking to Gemini:
Gemini's
GenerateContentendpoint validates every tool's JSON schema and refuses any"enum": [...]that contains an empty string. PR #288'sskills_manageschema used""as the sentinel for "knowledge-only skill" (no callable shell / prompt registered):This works on Anthropic / OpenAI / Mistral but trips Gemini's stricter validator on the first tool call — so any operator who enabled
self_improving_skills.self_manage(whichmax-buildprofile flips on) and points at a Gemini model gets a 400 on every chat request.Fix
Drop
""from the enum so it's just["shell", "prompt"]. The handler already treats absent / missingkindas knowledge-only —AssembleSKILLMDonly emits thekind:frontmatter line whenGetStr('kind', '') <> ''— so this is a schema cleanup, not a behaviour change. The new description string spells out the omit-for-knowledge-only semantic so the model knows the contract from the tool spec directly.Test plan
make test-self-improving-skillspasses — the test exercises a knowledge-only skill (nokindpassed) and confirms the SKILL.md round-trips correctlysrc/pkg/for otherenum: [""...]/enum: ['',...]patterns — none. This was the only one.https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
Generated by Claude Code