Feat/minimax anthropic routing (#75)

* feat: update MiniMax integration to use Anthropic-compatible endpoint and enhance routing logic

* refactor: streamline OAuth install hint and update ccproxy health check timeout
This commit is contained in:
Xi Zhang
2026-03-19 16:01:06 +01:00
committed by GitHub
parent a011dca693
commit 47e5ef6219
8 changed files with 163 additions and 90 deletions
+10 -10
View File
@@ -76,10 +76,7 @@ def _is_editable_install() -> bool:
def _oauth_install_hint() -> str:
"""Return the appropriate install command depending on install method."""
if _is_editable_install():
return (
"uv sync --extra oauth "
"or pip install -e '.[oauth]'"
)
return "uv sync --extra oauth or pip install -e '.[oauth]'"
return "pip install 'evoscientist[oauth]'"
@@ -189,7 +186,7 @@ def start_ccproxy(port: int) -> subprocess.Popen:
The Popen handle for the ccproxy process.
Raises:
RuntimeError: If ccproxy fails to become healthy within 10 seconds.
RuntimeError: If ccproxy fails to become healthy within 30 seconds.
FileNotFoundError: If ccproxy binary is not found.
"""
exe = _ccproxy_exe() or "ccproxy"
@@ -315,10 +312,13 @@ def _patch_ccproxy_oauth_header() -> None:
# Ask that Python where ccproxy's adapter lives
result = subprocess.run(
[
python_exe, "-c",
python_exe,
"-c",
"import inspect, ccproxy.plugins.claude_api.adapter as m; print(inspect.getfile(m))",
],
capture_output=True, text=True, timeout=10,
capture_output=True,
text=True,
timeout=10,
)
if result.returncode != 0:
return
@@ -345,10 +345,10 @@ def _patch_ccproxy_oauth_header() -> None:
text,
)
# Step 2: insert correct assignment after the cli_headers block
insert_after = 'filtered_headers[lk] = value\n'
insert_after = "filtered_headers[lk] = value\n"
replacement = (
'filtered_headers[lk] = value\n\n'
' # oauth-2025-04-20: required for OAuth Bearer token auth (Anthropic 2026-03)\n'
"filtered_headers[lk] = value\n\n"
" # oauth-2025-04-20: required for OAuth Bearer token auth (Anthropic 2026-03)\n"
' filtered_headers["anthropic-beta"] = "oauth-2025-04-20"\n'
)
patched = patched.replace(insert_after, replacement, 1)