@howaboua/pi-codex-conversion 1.5.6-dev.32.699e826 → 1.5.6
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/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 1.5.7
|
|
4
|
-
|
|
5
|
-
- Fixed OpenAI Codex custom-provider requests so synthetic `web.run` and `image_generation` adapter tools are rewritten to native Responses tool payloads before sending.
|
|
6
|
-
- Fixed subagent and other RPC/no-session Codex runs failing with invalid function tool names when native web search is active.
|
|
7
|
-
|
|
8
3
|
## 1.5.6
|
|
9
4
|
|
|
10
5
|
- Added Compaction and Overrides tabs to `/codex`.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -64,10 +64,6 @@ export default function codexConversion(pi: ExtensionAPI) {
|
|
|
64
64
|
|
|
65
65
|
registerOpenAICodexCustomProvider(pi, {
|
|
66
66
|
getCurrentCwd: () => state.cwd,
|
|
67
|
-
getNativeToolRewriteConfig: () => ({
|
|
68
|
-
webSearch: !state.config.applyPatchOnly && state.config.webSearch,
|
|
69
|
-
imageGeneration: !state.config.applyPatchOnly && state.config.imageGeneration,
|
|
70
|
-
}),
|
|
71
67
|
});
|
|
72
68
|
registerApplyPatchTool(pi);
|
|
73
69
|
registerExecCommandTool(pi, tracker, sessions);
|
|
@@ -21,8 +21,6 @@ import {
|
|
|
21
21
|
processResponsesStream,
|
|
22
22
|
} from "./openai-responses-shared.ts";
|
|
23
23
|
import { WEB_SEARCH_TOOL_NAME } from "../adapter/tool-set.ts";
|
|
24
|
-
import { rewriteNativeImageGenerationTool } from "../tools/image-generation-tool.ts";
|
|
25
|
-
import { rewriteNativeWebSearchTool } from "../tools/web-search-tool.ts";
|
|
26
24
|
|
|
27
25
|
const DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
28
26
|
const JWT_CLAIM_PATH = "https://api.openai.com/auth";
|
|
@@ -1540,7 +1538,6 @@ function createCodexStream<TApi extends Api>(
|
|
|
1540
1538
|
options: SimpleStreamOptions | undefined,
|
|
1541
1539
|
deps: {
|
|
1542
1540
|
getCurrentCwd: () => string;
|
|
1543
|
-
getNativeToolRewriteConfig?: () => { webSearch: boolean; imageGeneration: boolean };
|
|
1544
1541
|
onImageSaved?: (savedImage: SavedGeneratedImage, imageData: { data: string; mimeType: string }) => void;
|
|
1545
1542
|
onWebSearchCaptured?: (search: SurfacedWebSearch) => void;
|
|
1546
1543
|
},
|
|
@@ -1564,13 +1561,6 @@ function createCodexStream<TApi extends Api>(
|
|
|
1564
1561
|
if (nextBody !== undefined) {
|
|
1565
1562
|
body = nextBody as ResponsesBody;
|
|
1566
1563
|
}
|
|
1567
|
-
const nativeToolRewriteConfig = deps.getNativeToolRewriteConfig?.();
|
|
1568
|
-
if (nativeToolRewriteConfig?.webSearch) {
|
|
1569
|
-
body = rewriteNativeWebSearchTool(body, model) as ResponsesBody;
|
|
1570
|
-
}
|
|
1571
|
-
if (nativeToolRewriteConfig?.imageGeneration) {
|
|
1572
|
-
body = rewriteNativeImageGenerationTool(body, model) as ResponsesBody;
|
|
1573
|
-
}
|
|
1574
1564
|
|
|
1575
1565
|
const websocketRequestId = options?.sessionId || createCodexRequestId();
|
|
1576
1566
|
const sseHeaders = buildSSEHeaders(model.headers, options?.headers, accountId, apiKey, options?.sessionId);
|
|
@@ -1702,7 +1692,7 @@ function createCodexStream<TApi extends Api>(
|
|
|
1702
1692
|
return stream;
|
|
1703
1693
|
}
|
|
1704
1694
|
|
|
1705
|
-
export function registerOpenAICodexCustomProvider(pi: ExtensionAPI, options: { getCurrentCwd: () => string
|
|
1695
|
+
export function registerOpenAICodexCustomProvider(pi: ExtensionAPI, options: { getCurrentCwd: () => string }): void {
|
|
1706
1696
|
const pendingActivities: PendingActivity[] = [];
|
|
1707
1697
|
const imagePreviewCache = new Map<string, CachedImagePreview>();
|
|
1708
1698
|
let pendingFlushTimer: ReturnType<typeof setTimeout> | undefined;
|
|
@@ -1764,7 +1754,6 @@ export function registerOpenAICodexCustomProvider(pi: ExtensionAPI, options: { g
|
|
|
1764
1754
|
streamSimple: (model, context, streamOptions) =>
|
|
1765
1755
|
createCodexStream(model, context, streamOptions, {
|
|
1766
1756
|
getCurrentCwd: options.getCurrentCwd,
|
|
1767
|
-
getNativeToolRewriteConfig: options.getNativeToolRewriteConfig,
|
|
1768
1757
|
onImageSaved: (savedImage, imageData) => {
|
|
1769
1758
|
pendingActivities.push({ kind: "image", savedImage, imageData });
|
|
1770
1759
|
},
|
|
Binary file
|
|
Binary file
|