mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-10-19 13:30:37 +00:00
OpenCode chat-completions upstreams reject tool names longer than 64
characters ("name must be at most 64 characters, got 68"), which Claude
Code MCP tool names routinely exceed. The registry-scoped length alias
only ran in DefaultExecutor; OpencodeExecutor extends BaseExecutor, so
names reached opencode.ai unchanged.
- Extract the DefaultExecutor alias block into a reusable
open-sse/executors/toolNameLengthAlias.ts (applyToolNameLengthAliases
with a pluggable normalizer, applyRegistryToolNameLengthAliases, and
mergeToolNameAliases for the non-enumerable _toolNameMap side channel).
DefaultExecutor now calls it; behavior unchanged.
- OpencodeExecutor applies it last in transformRequest, only on the
chat-completions surface; Claude/Responses surfaces are untouched.
- Declare toolNameMaxLength: 64 on opencode, opencode-zen, opencode-go.
Aliases reuse normalizeOpenAIToolNames (prefix + sha256-12, collision
safe) and are restored in responses through the existing _toolNameMap
consumer in chatCore.
Co-authored-by: MakdumIbrohim <makdumibrohim3@gmail.com>
Inspired-by: https://github.com/decolua/9router/pull/3637
|
||
|---|---|---|
| .. | ||
| _helpers | ||
| _setup | ||
| benchmarks | ||
| boundary | ||
| e2e | ||
| fixtures | ||
| golden-set | ||
| helpers | ||
| homolog | ||
| integration | ||
| live | ||
| llm-security | ||
| load | ||
| manual | ||
| security | ||
| snapshots | ||
| translator | ||
| unit | ||
| _cp_mock_hook.mts | ||
| _cp_mock_module.mts | ||
| _run_dns_guard_test.sh | ||
| e2e-tool-calls.sh | ||