validate tool names at tools_schema() against strictest provider regex #32
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
During Phase 2 verify (TC #26 against
:model cloud), an actual HTTP 400 from openrouter→Amazon Bedrock surfaced the constraint:We fixed it by switching the alias separator from
.to__(commitf26cbd9). But the validation gap is generic — a future MCP server could register a tool with a name containing characters outside this regex (e.g.read-file:v2,tool.fast), and aish would emit it on the wire only to be rejected by a strict provider.Ask
In
repl.lua::tools_schema()(ormcp.lua::list_tools), validate eachalias .. "__" .. t.nameagainst the Bedrock regex before emitting. On violation: log a startup status ([aish] tool X has name characters outside ^[a-zA-Z0-9_-]+$; will fail with strict providers) and either:Picking the policy needs a Q in the manifest if Norris/Phase 3 reaches for the same area.
Why now
Not blocking — Phase 2 v1 ships fine with the manual
__convention. But the gap is shaped like a footgun: a user adds an MCP server with non-conformant tool names and gets the same uninformative breakage we just walked through. Validation is ~6 lines, runs once per session, no perf concern.