@kenkaiiii/gg-ai 4.3.194 → 4.3.196
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1536,8 +1536,7 @@ async function* runStream3(options) {
|
|
|
1536
1536
|
input,
|
|
1537
1537
|
tool_choice: "auto",
|
|
1538
1538
|
parallel_tool_calls: true,
|
|
1539
|
-
include: ["reasoning.encrypted_content"]
|
|
1540
|
-
...options.maxTokens ? { max_output_tokens: options.maxTokens } : {}
|
|
1539
|
+
include: ["reasoning.encrypted_content"]
|
|
1541
1540
|
};
|
|
1542
1541
|
if (options.tools?.length) {
|
|
1543
1542
|
body.tools = toCodexTools(options.tools);
|
|
@@ -1579,7 +1578,7 @@ async function* runStream3(options) {
|
|
|
1579
1578
|
const text = await response.text().catch(() => "");
|
|
1580
1579
|
const parsed = parseCodexErrorBody(text);
|
|
1581
1580
|
const message = parsed.message ?? `Codex API returned HTTP ${response.status}.`;
|
|
1582
|
-
const requestId = parsed.requestId ?? response.headers.get("x-request-id") ?? response.headers.get("openai-request-id") ?? void 0;
|
|
1581
|
+
const requestId = parsed.requestId ?? response.headers.get("x-request-id") ?? response.headers.get("openai-request-id") ?? response.headers.get("x-oai-request-id") ?? void 0;
|
|
1583
1582
|
let hint;
|
|
1584
1583
|
if (response.status === 400 && text.includes("not supported")) {
|
|
1585
1584
|
if (options.model === "gpt-5.5-pro") {
|
|
@@ -1917,7 +1916,8 @@ function parseCodexErrorBody(text) {
|
|
|
1917
1916
|
try {
|
|
1918
1917
|
const parsed = JSON.parse(text);
|
|
1919
1918
|
const error = parsed.error;
|
|
1920
|
-
const
|
|
1919
|
+
const detail = parsed.detail;
|
|
1920
|
+
const message = error?.message ?? parsed.message ?? (typeof detail === "string" ? detail : void 0);
|
|
1921
1921
|
const requestId = parsed.request_id ?? error?.request_id ?? (message ? extractCodexRequestId(message) : void 0);
|
|
1922
1922
|
return { ...message ? { message } : {}, ...requestId ? { requestId } : {} };
|
|
1923
1923
|
} catch {
|