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:
@@ -48,19 +48,21 @@ 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",
|
||||||
"write": "Write",
|
"write": "Write",
|
||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"glob": "Glob",
|
"glob": "Glob",
|
||||||
"grep": "Grep",
|
"grep": "Grep",
|
||||||
"task": "Task",
|
"task": "Task",
|
||||||
"webfetch": "WebFetch",
|
"webfetch": "WebFetch",
|
||||||
"todowrite": "TodoWrite",
|
"todowrite": "TodoWrite",
|
||||||
"ls": "LS",
|
"question": "Question",
|
||||||
"todoread": "TodoRead",
|
"skill": "Skill",
|
||||||
|
"ls": "LS",
|
||||||
|
"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.
|
||||||
|
|||||||
Reference in New Issue
Block a user