nanoclaw init
Some checks failed
Sync upstream & merge-forward skill branches / sync-and-merge (push) Has been cancelled
Merge-forward skill branches / merge-forward (push) Has been cancelled
Bump version / bump-version (push) Has been cancelled
Update token count / update-tokens (push) Has been cancelled

This commit is contained in:
woozu-shin
2026-03-24 01:43:09 +09:00
parent a1b8c70b5c
commit 4dc270d2dd
10 changed files with 1541 additions and 30 deletions

View File

@@ -41,6 +41,9 @@ export function startCredentialProxy(
const upstreamUrl = new URL(
secrets.ANTHROPIC_BASE_URL || 'https://api.anthropic.com',
);
// Preserve the base URL's pathname prefix (e.g. /anthropic for MiniMax)
// so requests to /v1/messages become /anthropic/v1/messages upstream.
const basePath = upstreamUrl.pathname.replace(/\/+$/, '');
const isHttps = upstreamUrl.protocol === 'https:';
const makeRequest = isHttps ? httpsRequest : httpRequest;
@@ -83,7 +86,7 @@ export function startCredentialProxy(
{
hostname: upstreamUrl.hostname,
port: upstreamUrl.port || (isHttps ? 443 : 80),
path: req.url,
path: basePath + req.url,
method: req.method,
headers,
} as RequestOptions,