Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions plugins/provider-codex/src/bridge/bridge.calibration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const SCRIPT: (ScriptedNotification | ScriptedRequest)[][] = [
text: "checking the tree",
phase: null,
memoryCitation: null,
delivery: null,
},
}),
APPROVAL_REQUEST,
Expand All @@ -167,6 +168,8 @@ const SCRIPT: (ScriptedNotification | ScriptedRequest)[][] = [
command: "git status --short",
cwd: "/tmp/project",
processId: null,
pluginId: null,
scriptPath: null,
source: "agent",
status: "inProgress",
commandActions: [],
Expand All @@ -191,6 +194,8 @@ const SCRIPT: (ScriptedNotification | ScriptedRequest)[][] = [
command: "git status --short",
cwd: "/tmp/project",
processId: null,
pluginId: null,
scriptPath: null,
source: "agent",
status: "completed",
commandActions: [],
Expand All @@ -212,6 +217,8 @@ const SCRIPT: (ScriptedNotification | ScriptedRequest)[][] = [
command: "git status --short",
cwd: "/tmp/project",
processId: null,
pluginId: null,
scriptPath: null,
source: "agent",
status: "completed",
commandActions: [],
Expand All @@ -232,6 +239,8 @@ const SCRIPT: (ScriptedNotification | ScriptedRequest)[][] = [
command: "git status --short",
cwd: "/tmp/project",
processId: null,
pluginId: null,
scriptPath: null,
source: "agent",
status: "inProgress",
commandActions: [],
Expand All @@ -250,6 +259,8 @@ const SCRIPT: (ScriptedNotification | ScriptedRequest)[][] = [
command: "git status --short",
cwd: "/tmp/project",
processId: null,
pluginId: null,
scriptPath: null,
source: "agent",
status: "completed",
commandActions: [],
Expand Down Expand Up @@ -289,6 +300,7 @@ const SCRIPT: (ScriptedNotification | ScriptedRequest)[][] = [
text: "",
phase: null,
memoryCitation: null,
delivery: null,
},
}),
codexNotification("item/completed", {
Expand All @@ -301,6 +313,7 @@ const SCRIPT: (ScriptedNotification | ScriptedRequest)[][] = [
text: "all done",
phase: null,
memoryCitation: null,
delivery: null,
},
}),
codexNotification("turn/completed", {
Expand Down
28 changes: 28 additions & 0 deletions plugins/provider-codex/src/delta-translation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,16 @@ describe("codex thread lifecycle translation", () => {
parentThreadId: null,
preview: "Fix the tests",
ephemeral: false,

section: null,

sectionEnteredAt: null,

projectId: null,
modelProvider: "openai",
createdAt: 0,
updatedAt: 0,
recencyAt: null,
status: { type: "idle" },
path: null,
cwd: "/tmp",
Expand Down Expand Up @@ -440,6 +447,7 @@ describe("codex item translation", () => {
text: "Hello",
phase: null,
memoryCitation: null,
delivery: null,
},
}),
);
Expand Down Expand Up @@ -626,6 +634,8 @@ describe("codex item translation", () => {
command: "ls -la",
cwd: "/tmp",
processId: null,
pluginId: null,
scriptPath: null,
source: "agent",
status: "completed",
commandActions: [],
Expand Down Expand Up @@ -665,6 +675,8 @@ describe("codex item translation", () => {
command: "ls -la",
cwd: "/tmp",
processId: null,
pluginId: null,
scriptPath: null,
source: "agent",
status: "declined",
commandActions: [],
Expand Down Expand Up @@ -700,6 +712,8 @@ describe("codex item translation", () => {
command: "ls -la",
cwd: "/tmp",
processId: null,
pluginId: null,
scriptPath: null,
source: "agent",
status: "declined",
commandActions: [],
Expand Down Expand Up @@ -800,6 +814,8 @@ describe("codex item translation", () => {
server: "myserver",
tool: "search",
pluginId: null,
appContext: null,
readOnlyHint: null,
status: "completed",
arguments: { query: "test" },
result: null,
Expand Down Expand Up @@ -1250,6 +1266,7 @@ describe("codex web item translation", () => {
type: "webSearch",
id: "web-1",
query: "react suspense",
results: null,
action: { type: "search", query: "react suspense", queries: null },
},
}),
Expand Down Expand Up @@ -1279,6 +1296,7 @@ describe("codex web item translation", () => {
type: "webSearch",
id: "web-start-1",
query: "react suspense fallback",
results: null,
action: {
type: "search",
query: "react suspense primary",
Expand Down Expand Up @@ -1317,6 +1335,7 @@ describe("codex web item translation", () => {
type: "webSearch",
id: "web-open-1",
query: "ignored fallback",
results: null,
action: { type: "openPage", url: "https://example.com" },
},
}),
Expand Down Expand Up @@ -1345,6 +1364,7 @@ describe("codex web item translation", () => {
type: "webSearch",
id: "web-open-1",
query: "https://example.com",
results: null,
action: { type: "openPage", url: "https://example.com" },
},
}),
Expand Down Expand Up @@ -1375,6 +1395,7 @@ describe("codex web item translation", () => {
type: "webSearch",
id: "web-find-1",
query: "https://example.com",
results: null,
action: {
type: "findInPage",
url: "https://example.com",
Expand Down Expand Up @@ -1415,6 +1436,7 @@ describe("codex web item translation", () => {
type: "webSearch",
id: "web-placeholder-1",
query: "",
results: null,
action: { type: "other" },
},
}),
Expand All @@ -1430,6 +1452,7 @@ describe("codex web item translation", () => {
type: "webSearch",
id: "web-placeholder-completed-1",
query: "",
results: null,
action: null,
},
}),
Expand All @@ -1448,6 +1471,7 @@ describe("codex web item translation", () => {
type: "webSearch",
id: "web-open-missing-url-1",
query: "not-a-url",
results: null,
action: { type: "openPage", url: null },
},
}),
Expand Down Expand Up @@ -1551,13 +1575,15 @@ describe("codex delta and usage translation", () => {
totalTokens: 100,
inputTokens: 60,
cachedInputTokens: 10,
cacheWriteInputTokens: 0,
outputTokens: 30,
reasoningOutputTokens: 0,
},
last: {
totalTokens: 50,
inputTokens: 30,
cachedInputTokens: 5,
cacheWriteInputTokens: 0,
outputTokens: 15,
reasoningOutputTokens: 0,
},
Expand Down Expand Up @@ -1889,6 +1915,7 @@ describe("codex account rate-limit translation", () => {
secondary: null,
credits: null,
individualLimit: null,
spendControlReached: null,
planType: null,
rateLimitReachedType: "rate_limit_reached",
},
Expand Down Expand Up @@ -1940,6 +1967,7 @@ describe("codex account rate-limit translation", () => {
remainingPercent: 0,
resetsAt: 1_781_120_400,
},
spendControlReached: null,
planType: "pro",
rateLimitReachedType: "rate_limit_reached",
},
Expand Down
16 changes: 9 additions & 7 deletions plugins/provider-codex/src/generated/codex-app-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,28 @@ adapter imports concrete schema files directly (e.g.
types are unreachable. The committed tree is therefore pruned to the
transitive type-import closure of the hand-written importers:

- `adapter.ts`, `visibility.ts`, `permission-mapping.ts`,
`interactive-requests.ts`, `adapter.test.ts`.
- `translator.ts`, `visibility.ts`, `interactive-requests.ts`,
`session-params.ts`, `bridge/bridge.ts`, and their `*.test.ts` files.

At the time of pruning that was 336 of the ~580 emitted files; the
unreachable files and all three `export *` barrels (`index.ts`,
At the last regenerate (Codex 0.149.1) that was 235 of the 663 emitted
files; the unreachable files and all three `export *` barrels (`index.ts`,
`schema/index.ts`, `schema/v2/index.ts`) were removed. Nothing imports the
barrels, so their removal is type-safe.

### Re-prune after regenerating

A regenerate (the commands above) re-emits the full set plus the barrels.
After copying the schema in, delete everything not reachable from the
The committed tree matches the **stable** surface; the hand-written code
uses no experimental fields. After copying the schema in, rewrite relative
imports to `.js` specifiers, delete everything not reachable from the
importers listed above (and the barrels), then verify:

```bash
pnpm exec turbo run typecheck --filter=@bb/agent-runtime
pnpm exec turbo run typecheck --filter=bb-plugin-provider-codex
```

TypeScript reports any over-deletion as a missing-module error; a green
typecheck plus `pnpm exec turbo run test --filter=@bb/agent-runtime` confirms
typecheck plus `pnpm exec turbo run test --filter=bb-plugin-provider-codex` confirms
the kept subset is complete. Keep it pruned to avoid re-vendoring dead types.

## Source of truth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type AgentMessageInputContent = { "type": "encrypted_content", encrypted_content: string, };
export type AgentMessageInputContent = { "type": "input_text", text: string, } | { "type": "encrypted_content", encrypted_content: string, };
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
/**
* Authentication mode for OpenAI-backed providers.
*/
export type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "agentIdentity" | "personalAccessToken";
export type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "headers" | "agentIdentity" | "personalAccessToken" | "bedrockApiKey";
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ImageDetail } from "./ImageDetail.js";

export type ContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, detail?: ImageDetail, } | { "type": "output_text", text: string, };
export type ContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, detail?: ImageDetail, } | { "type": "input_audio", audio_url: string, } | { "type": "output_text", text: string, };
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ import type { ImageDetail } from "./ImageDetail.js";
* Responses API compatible content items that can be returned by a tool call.
* This is a subset of ContentItem with the types we support as function call outputs.
*/
export type FunctionCallOutputContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, detail?: ImageDetail, } | { "type": "encrypted_content", encrypted_content: string, };
export type FunctionCallOutputContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, detail?: ImageDetail, } | { "type": "input_audio", audio_url: string, } | { "type": "encrypted_content", encrypted_content: string, };
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type ImageGenerationFailure = { "type": "usageLimitExceeded", limitId: string, resetsAt: number | null, };
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AbsolutePathBuf } from "./AbsolutePathBuf.js";
import type { ImageGenerationFailure } from "./ImageGenerationFailure.js";

export type ImageGenerationItem = { id: string, status: string, revisedPrompt: string | null, result: string, transparentBackground?: boolean, failure: ImageGenerationFailure | null, savedPath?: AbsolutePathBuf, };
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Internal Responses API passthrough metadata copied into underlying chat messages.
*
* Responses API strongly types this payload. Do not modify it without first getting API
* approval and making the corresponding Responses API change.
*/
export type InternalChatMessageMetadataPassthrough = { turn_id?: string, };
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* A UTF-8 path for preserving raw path compatibility at the app-server API
* boundary while Codex migrates to [`PathUri`].
*
* Supports storing arbitrary strings read from the API and converting to and
* from [`PathUri`] using an explicitly selected native path convention.
*
* When converting from [`PathUri`], "native" refers to the supplied
* [`PathConvention`], which may be foreign to the operating system running
* this process. The inner string is private so path-producing code must use a
* path conversion method instead of bypassing the intended conversion
* boundary. Non-UTF-8 paths are converted to UTF-8 lossily because this API
* value is serialized as a JSON string.
*
* Deserialization and [`Self::from_string`] accept any UTF-8 string without
* interpreting or validating it. Use [`Self::from_string`] when a caller
* already owns legacy app-server path text and needs to preserve its wire
* spelling; use [`Self::from_path`], [`Self::from_abs_path`], or
* [`Self::from_path_uri`] when converting an actual path value. Relative
* path text remains valid until an operation such as [`Self::to_path_uri`]
* requires an absolute path.
*/
export type LegacyAppPathString = string;
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_usage_based" | "business" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "unknown";
export type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_prolite" | "self_serve_business_usage_based" | "business" | "ent26" | "enterprise_cbp_automation" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "edu_plus" | "edu_pro" | "unknown";
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type RealtimeConversationVersion = "v1" | "v2";
export type RealtimeConversationVersion = "v1" | "v2" | "v3";
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
import type { AgentMessageInputContent } from "./AgentMessageInputContent.js";
import type { ContentItem } from "./ContentItem.js";
import type { FunctionCallOutputBody } from "./FunctionCallOutputBody.js";
import type { InternalChatMessageMetadataPassthrough } from "./InternalChatMessageMetadataPassthrough.js";
import type { LocalShellAction } from "./LocalShellAction.js";
import type { LocalShellStatus } from "./LocalShellStatus.js";
import type { MessagePhase } from "./MessagePhase.js";
import type { ReasoningItemContent } from "./ReasoningItemContent.js";
import type { ReasoningItemReasoningSummary } from "./ReasoningItemReasoningSummary.js";
import type { ResponseItemId } from "./ResponseItemId.js";
import type { WebSearchAction } from "./WebSearchAction.js";

export type ResponseItem = { "type": "message", role: string, content: Array<ContentItem>, phase?: MessagePhase, } | { "type": "agent_message", author: string, recipient: string, content: Array<AgentMessageInputContent>, } | { "type": "reasoning", summary: Array<ReasoningItemReasoningSummary>, content?: Array<ReasoningItemContent>, encrypted_content: string | null, } | { "type": "local_shell_call",
export type ResponseItem = { "type": "message", id?: ResponseItemId, role: string, content: Array<ContentItem>, phase?: MessagePhase, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "agent_message", id?: ResponseItemId, author: string, recipient: string, content: Array<AgentMessageInputContent>, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "reasoning", id?: ResponseItemId, summary: Array<ReasoningItemReasoningSummary>, content?: Array<ReasoningItemContent>, encrypted_content: string | null, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "local_shell_call",
/**
* Legacy id field retained for compatibility with older payloads.
*/
id?: ResponseItemId,
/**
* Set when using the Responses API.
*/
call_id: string | null, status: LocalShellStatus, action: LocalShellAction, } | { "type": "function_call", name: string, namespace?: string, arguments: string, call_id: string, } | { "type": "tool_search_call", call_id: string | null, status?: string, execution: string, arguments: unknown, } | { "type": "function_call_output", call_id: string, output: FunctionCallOutputBody, } | { "type": "custom_tool_call", status?: string, call_id: string, name: string, input: string, } | { "type": "custom_tool_call_output", call_id: string, name?: string, output: FunctionCallOutputBody, } | { "type": "tool_search_output", call_id: string | null, status: string, execution: string, tools: unknown[], } | { "type": "web_search_call", status?: string, action?: WebSearchAction, } | { "type": "image_generation_call", id: string, status: string, revised_prompt?: string, result: string, } | { "type": "compaction", encrypted_content: string, } | { "type": "compaction_trigger" } | { "type": "context_compaction", encrypted_content?: string, } | { "type": "other" };
call_id: string | null, status: LocalShellStatus, action: LocalShellAction, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "function_call", id?: ResponseItemId, name: string, namespace?: string, arguments: string, encrypted_function_args?: Array<string>, call_id: string, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "tool_search_call", id?: ResponseItemId, call_id: string | null, status?: string, execution: string, arguments: unknown, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "function_call_output", id?: ResponseItemId, call_id: string, output: FunctionCallOutputBody, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "custom_tool_call", id?: ResponseItemId, status?: string, call_id: string, name: string, namespace?: string, input: string, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "custom_tool_call_output", id?: ResponseItemId, call_id: string, name?: string, output: FunctionCallOutputBody, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "tool_search_output", id?: ResponseItemId, call_id: string | null, status: string, execution: string, tools: unknown[], internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "web_search_call", id?: ResponseItemId, status?: string, action?: WebSearchAction, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "image_generation_call", id?: ResponseItemId, status: string, revised_prompt?: string, result: string, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "compaction", id?: ResponseItemId, encrypted_content: string, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "compaction_trigger", } | { "type": "context_compaction", id?: ResponseItemId, encrypted_content?: string, internal_chat_message_metadata_passthrough?: InternalChatMessageMetadataPassthrough, } | { "type": "other" };
Loading
Loading