fix(claude): map question/skill to TitleCase instead of removing them

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
wykk-12138
2026-04-09 22:28:00 +08:00
parent ac36119a02
commit f780c289e8
+6 -7
View File
@@ -48,7 +48,7 @@ const claudeToolPrefix = ""
// oauthToolRenameMap maps OpenCode-style (lowercase) tool names to Claude Code-style // oauthToolRenameMap maps OpenCode-style (lowercase) tool names to Claude Code-style
// (TitleCase) names. Anthropic uses tool name fingerprinting to detect third-party // (TitleCase) names. Anthropic uses tool name fingerprinting to detect third-party
// clients on OAuth traffic. Renaming to official names avoids extra-usage billing. // clients on OAuth traffic. Renaming to official names avoids extra-usage billing.
// Tools without a Claude Code equivalent (e.g. "question", "skill") are removed entirely. // All tools are mapped to TitleCase equivalents to match Claude Code naming patterns.
var oauthToolRenameMap = map[string]string{ var oauthToolRenameMap = map[string]string{
"bash": "Bash", "bash": "Bash",
"read": "Read", "read": "Read",
@@ -59,6 +59,8 @@ var oauthToolRenameMap = map[string]string{
"task": "Task", "task": "Task",
"webfetch": "WebFetch", "webfetch": "WebFetch",
"todowrite": "TodoWrite", "todowrite": "TodoWrite",
"question": "Question",
"skill": "Skill",
"ls": "LS", "ls": "LS",
"todoread": "TodoRead", "todoread": "TodoRead",
"notebookedit": "NotebookEdit", "notebookedit": "NotebookEdit",
@@ -73,12 +75,9 @@ var oauthToolRenameReverseMap = func() map[string]string {
return m return m
}() }()
// oauthToolsToRemove lists tool names that have no Claude Code equivalent and must // oauthToolsToRemove lists tool names that must be stripped from OAuth requests
// be stripped from OAuth requests to avoid third-party fingerprinting. // even after remapping. Currently empty — all tools are mapped instead of removed.
var oauthToolsToRemove = map[string]bool{ var oauthToolsToRemove = map[string]bool{}
"question": true,
"skill": true,
}
// Anthropic-compatible upstreams may reject or even crash when Claude models // Anthropic-compatible upstreams may reject or even crash when Claude models
// omit max_tokens. Prefer registered model metadata before using a fallback. // omit max_tokens. Prefer registered model metadata before using a fallback.