@kenkaiiii/gg-ai 4.3.194 → 4.3.195
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.cjs
CHANGED
|
@@ -1585,8 +1585,7 @@ async function* runStream3(options) {
|
|
|
1585
1585
|
input,
|
|
1586
1586
|
tool_choice: "auto",
|
|
1587
1587
|
parallel_tool_calls: true,
|
|
1588
|
-
include: ["reasoning.encrypted_content"]
|
|
1589
|
-
...options.maxTokens ? { max_output_tokens: options.maxTokens } : {}
|
|
1588
|
+
include: ["reasoning.encrypted_content"]
|
|
1590
1589
|
};
|
|
1591
1590
|
if (options.tools?.length) {
|
|
1592
1591
|
body.tools = toCodexTools(options.tools);
|
|
@@ -1628,7 +1627,7 @@ async function* runStream3(options) {
|
|
|
1628
1627
|
const text = await response.text().catch(() => "");
|
|
1629
1628
|
const parsed = parseCodexErrorBody(text);
|
|
1630
1629
|
const message = parsed.message ?? `Codex API returned HTTP ${response.status}.`;
|
|
1631
|
-
const requestId = parsed.requestId ?? response.headers.get("x-request-id") ?? response.headers.get("openai-request-id") ?? void 0;
|
|
1630
|
+
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;
|
|
1632
1631
|
let hint;
|
|
1633
1632
|
if (response.status === 400 && text.includes("not supported")) {
|
|
1634
1633
|
if (options.model === "gpt-5.5-pro") {
|
|
@@ -1966,7 +1965,8 @@ function parseCodexErrorBody(text) {
|
|
|
1966
1965
|
try {
|
|
1967
1966
|
const parsed = JSON.parse(text);
|
|
1968
1967
|
const error = parsed.error;
|
|
1969
|
-
const
|
|
1968
|
+
const detail = parsed.detail;
|
|
1969
|
+
const message = error?.message ?? parsed.message ?? (typeof detail === "string" ? detail : void 0);
|
|
1970
1970
|
const requestId = parsed.request_id ?? error?.request_id ?? (message ? extractCodexRequestId(message) : void 0);
|
|
1971
1971
|
return { ...message ? { message } : {}, ...requestId ? { requestId } : {} };
|
|
1972
1972
|
} catch {
|