can1357/oh-my-pi · error · AIError.ConfigurationError
Invalid QwenCloud Cookie header. Copy the complete Cookie re
Error message
Invalid QwenCloud Cookie header. Copy the complete Cookie request header from the ${cookieRequestHost} usage request, not a single cookie value. What it means
QwenCloud login can accept a full Cookie request header (multiple `name=value` segments separated by `;`). The login validates each semicolon-separated segment has a non-empty key and value; if the pasted value has no valid `key=value` segment, ConfigurationError is thrown telling the user to copy the complete Cookie header from the cookieRequestHost usage request rather than a single cookie value.
Source
Thrown at packages/ai/src/registry/alibaba-token-plan.ts:113
: "Optional quota reporting: open browser DevTools → Network, reload the Token Plan page, filter for api.json, and select the cs-data.qwencloud.com/data/api.json request whose api query ends in /tokenplan/personal/api/v2/usage. Copy Request Headers → Cookie, then paste the complete name=value; ... value here, or press Enter to skip.",
placeholder: "name=value; name=value; ...",
allowEmpty: true,
});
const cookie = rawCookie
.trim()
.replace(/^Cookie:\s*/i, "")
.trim();
if (options.signal?.aborted) {
throw new AIError.LoginCancelledError();
}
if (
cookie &&
!cookie.split(";").some(segment => {
const separator = segment.indexOf("=");
return separator > 0 && Boolean(segment.slice(0, separator).trim() && segment.slice(separator + 1).trim());
})
) {
throw new AIError.ConfigurationError(
`Invalid QwenCloud Cookie header. Copy the complete Cookie request header from the ${cookieRequestHost} usage request, not a single cookie value.`,
);
}
// International (default) logins keep their existing bare/cookie credential
// form; only a diverging region is persisted so it can override the catalog
// base URL at inference and discovery time.
const regionUrl = baseUrl === ALIBABA_TOKEN_PLAN_BASE_URL ? undefined : baseUrl;
return serializeAlibabaTokenPlanCredential(apiKey, cookie, regionUrl);
}
export const alibabaTokenPlanProvider = {
id: "alibaba-token-plan",
name: "QwenCloud Token Plan",
login: (cb: OAuthLoginCallbacks) => loginAlibabaTokenPlan(cb),
} as const satisfies ProviderDefinition;
View on GitHub (pinned to 9690622007)
Solutions
- Open browser devtools Network tab, find the usage request to the stated host, and copy the complete `Cookie:` request header value
- Ensure the copied string contains at least one valid `name=value` pair separated by semicolons
- Avoid copying from the Application/Storage cookie list; use the raw request header
- If you only have an API-key style credential, check whether the flow supports a bare-key form instead
Example fix
// before (single value, rejected) tokenXyz123 // after (complete header) login_tk=abc123; cna=xyz; t=456; sessionId=789
Defensive patterns
Strategy: validation
Validate before calling
function isCookieHeader(v) { return typeof v === 'string' && v.split(';').some(s => { const i = s.indexOf('='); return i > 0 && s.slice(0,i).trim() && s.slice(i+1).trim(); }); }
if (!isCookieHeader(pastedValue)) throw new Error('Paste the complete Cookie request header (name=value; ...), not a single cookie'); Type guard
function isCookieHeader(v: unknown): v is string { return typeof v === 'string' && v.split(';').some(seg => { const i = seg.indexOf('='); return i > 0 && Boolean(seg.slice(0, i).trim() && seg.slice(i + 1).trim()); }); } Try / catch
try { key = await loginAlibabaTokenPlan(controller); } catch (e) { if (e instanceof AIError.ConfigurationError && String(e.message).includes('Cookie header')) console.error('Recopy the full Cookie request header from the Network tab.'); else throw e; } Prevention
- Copy from the Network tab request header, not the cookie storage list
- Verify the paste contains at least one name=value pair before submitting
- Watch for terminal wrapping truncating long headers
- Use the bare API-key form when no browser session exists
When it happens
Trigger: Pasting a single cookie value (e.g. just the token string, or one `name=value` with empty name/value, no `=` at all) when the login flow expects the entire multi-pair Cookie header captured from the browser devtools request.
Common situations: Copying only one cookie from devtools Application tab instead of the request header; header truncated by terminal line wrapping; pasting a bearer token into the cookie prompt; expired/reformatted cookie copied from the wrong request.
Related errors
- CoreWeave Serverless Inference requires OpenAI-Project. Set
- Anthropic Files API credential is required
- credentials ${usernameKey} and ${passwordKey} must be config
- No API key for ${model.provider}/${model.id}
- No API key available for model ${model.provider}/${model.id}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/f03128cfdcd5b372.
Report an issue: GitHub.