fix(pi): strengthen final release proof

This commit is contained in:
2026-08-24 15:47:57 +08:00
parent c7e777246e
commit df1151b5eb
19 changed files with 1120 additions and 149 deletions

View File

@@ -205,7 +205,7 @@ function validateCapturedRequests(protocol, modelId, requests) {
const authHeader = protocol === 'anthropic-messages' ? 'x-api-key' : 'authorization';
const expectedAuth = protocol === 'anthropic-messages' ? LOCAL_API_KEY : `Bearer ${LOCAL_API_KEY}`;
const problems = [];
if (matching.length !== 4) problems.push(`expected 4 requests, got ${matching.length}`);
if (matching.length !== 6) problems.push(`expected 6 requests, got ${matching.length}`);
if (matching.some((request) => request.method !== 'POST')) problems.push('non-POST request');
if (matching.some((request) => request.path !== expectedPath(protocol))) problems.push('unexpected endpoint path');
if (matching.some((request) => request.headers[authHeader] !== expectedAuth)) problems.push('credential header mismatch');