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
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,57 @@ All notable package changes are documented here. The package version mirrors the
`codex-cli` version used to generate `src/`, and generated entries use
`codex app-server generate-ts --experimental`.

## 0.153.4 - 2026-09-06

Generated from exact released `codex-cli 0.153.4` with the experimental surface.
827 generated TypeScript files, up from 671 in 0.144.0. The client request union
adds 33 methods and the server notification union adds 14 methods; neither
union removes a method.

### Added

- `ServerNotificationEnvelope` with optional `emittedAtMs` (Unix milliseconds)
for server emission time; older servers may omit it. This is live notification
timing, not historical item timing.
- Server-managed thread queue add, update, delete, reorder, list, and start
RPCs, plus queue change notifications and `turn/settings/update`.
- Project CRUD, import, and move RPCs; thread section management; project and
section assignments on threads; thread revert and occurrence search.
- Experimental `thread/timeline/list`, combining ordinary items, realtime
items, and turn boundaries, plus backwards hydration cursors on resume.
- Agent-message delivery and asynchronous question metadata, a
`functionCallOutput` thread-item variant, and `toolOutput` on turn start.
- Audio and local-audio user input, realtime item lifecycle/transcript
notifications, and an `existingCall` realtime transport.
- Bedrock discovery/setup, provider auth recovery notifications, environment
status and connection notifications, and server diagnostics.
- MCP event streams, client extension declarations, expanded MCP metadata,
plugin search/reconciliation, app reads, and installed-app queries.
- Thread model/reasoning-effort/direct-input metadata, per-turn service tier,
fork-before-turn support, deferred fork goal continuation, model multi-agent
metadata, cache-write token accounting, and raw response usage notifications.

### Changed / consumer migration

- **`ThreadItemsListResponse.data` now contains `ThreadItemEntry` envelopes
(`{ turnId, item }`) instead of bare `ThreadItem` values.** Consumers must
unwrap `entry.item` and can use `entry.turnId` for attribution.
- `ToolRequestUserInputParams` adds required `isBlocking`; use it instead of
deprecated `autoResolutionMs` to decide whether a question blocks.
- Removed `AmazonBedrockCredentialSource`; the Bedrock account variant now
reports `usesCodexManagedCredentials` instead of `credentialSource`.
- `ReviewDecision` changes `"denied"` to `{ denied: { rejection: string } }`
and adds `"approved_mcp_policy_amendment"`.
- Many response types add required nullable fields, including `Thread`,
`Model`, agent messages, and resume responses. Update typed fixtures and
exhaustive union handling; newer declarations do not upgrade older servers.
- Full-history hydration is deprecated for paginated threads; prefer metadata
reads and `thread/turns/list` / `thread/items/list` pagination.
- **Historical per-item timestamps are still absent**, including item-list
envelopes and ordinary timeline entries. Preserve known live lifecycle times
and leave unknown historical times absent. See the README for the upstream
investigation and proposal.

## 0.144.0 - 2026-07-11

Generated from `codex-cli 0.144.0`.
Expand Down
107 changes: 102 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ header.
## Versioning — the package version mirrors the Codex CLI version

**This package's version equals the `codex-cli` version that generated it.**
So `@pwrdrvr/codex-app-server-protocol@0.144.0` was generated by `codex-cli
0.144.0`. Provenance is also recorded in `package.json`:
So `@pwrdrvr/codex-app-server-protocol@0.153.4` was generated by `codex-cli
0.153.4`. Provenance is also recorded in `package.json`:

```jsonc
{
"version": "0.144.0",
"codexCliVersion": "0.144.0", // the codex-cli that generated src/
"version": "0.153.4",
"codexCliVersion": "0.153.4", // the codex-cli that generated src/
"codexExperimental": true // generated with --experimental
}
```
Expand All @@ -45,7 +45,7 @@ dist-tag (`0.133.0-next.N` on `next`) and promote the clean `0.133.0` to
`latest` once happy. Do **not** bump the patch to `0.133.1` for a packaging fix —
that would falsely imply a Codex `0.133.1` surface.

Current generated source: **`codex-cli 0.144.0`** (671 generated `.ts` files;
Current generated source: **`codex-cli 0.153.4`** (827 generated `.ts` files;
v1 surface in `src/`, v2 surface in `src/v2/`).

## Install
Expand Down Expand Up @@ -103,6 +103,103 @@ The Rust source for the protocol lives in the Codex repo under
`codex-rs/app-server/`. The generator emits one TS file per Rust type, plus
barrel `index.ts` files.

## Historical item timing: upstream gap and proposal

Investigated **2026-09-06** against the latest stable
[Codex release, `0.153.4`](https://github.com/openai/codex/releases/tag/rust-v0.153.4)
(published September 4; commit `3d2ee51ca2d5db578f328aa75e20aa22c0197c9a`).
It does **not** expose historical per-item timestamps for ordinary messages,
plans, or activities. This package mirrors **0.153.4** for its other protocol changes; this release
does not solve historical item timing. Type declarations cannot make an older
or newer server send additional data.

| Wire surface in 0.153.4 | Timing available |
|---|---|
| `thread/read` → `thread.turns[].items[]` | Bare `ThreadItem`; no general item timestamp |
| `thread/turns/list` → `data[].items[]` | Bare `ThreadItem`; no general item timestamp |
| `thread/items/list` → `data[]` | `ThreadItemEntry` contains only `turnId` and `item` |
| Experimental `thread/timeline/list` → ordinary `item` entry | `position`, `turnId`, `item`; position is ordering, not time |
| `Turn` and timeline turn boundaries | `startedAt` / `completedAt` in Unix **seconds**, `durationMs` in milliseconds |
| Live notification envelope | Optional `emittedAtMs` in Unix **milliseconds**; server emission time |
| Live `item/started` notification | `startedAtMs` in Unix **milliseconds** |
| Live `item/completed` notification | `completedAtMs` in Unix **milliseconds** |

These findings come from the released
[Rust history envelopes](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/app-server-protocol/src/protocol/v2/thread.rs#L1743),
[generated Turn](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/app-server-protocol/schema/typescript/v2/Turn.ts),
and [generated ThreadItem](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts).
The six relevant generated definitions (`ThreadItem`, `ThreadItemEntry`,
`Turn`, and the three read/list responses) were also identical on upstream
`main` at `3cd6004dc43c96c38946d9697a7cf72af1562563`.
Item-specific tool durations are not general message creation timestamps.

### Where upstream loses the information

- The [history projection](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/app-server-protocol/src/protocol/thread_history_projection.rs#L70)
carries optional lifecycle start and completion times from persisted item
completion events into `ThreadHistoryItemChange`.
- The [item materializer](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/thread-store/src/local/thread_history.rs#L430)
uses lifecycle start, or a persisted record timestamp fallback, as
`created_at_ms`. It preserves the first creation value when updating an item.
The [fallback source](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/thread-store/src/local/thread_history_materialization.rs#L220)
is the record timestamp, not a guaranteed lifecycle start.
- [StoredThreadItem](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/thread-store/src/types.rs#L491)
exposes `created_at_ms` internally, but no separate lifecycle start/completion
fields. The [items response conversion](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/app-server/src/request_processors/thread_processor.rs#L3427)
retains only `turn_id` and deserialized `item_json`.
- The [stored-turn conversion](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/app-server/src/request_processors/thread_processor.rs#L5687)
likewise deserializes items without their metadata. The legacy
[history builder](https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/app-server-protocol/src/protocol/thread_history.rs#L1450)
records changed items with unknown lifecycle times. Adding a response field
alone would not repair all history paths.

Only public upstream source code and repository types were inspected;
no local Codex rollout, session, or SQLite data was accessed.

### Proposed upstream change (not an existing API)

Add a shared `ThreadItemTiming` type with nullable `startedAtMs` and
`completedAtMs`, explicitly defined as lifecycle times in Unix milliseconds.
Add optional `timing` to `ThreadItemEntry` and ordinary timeline item entries.
To preserve the existing `Turn.items: ThreadItem[]` shape, add an optional
`Turn.itemTimings` map keyed by item ID, populated for the returned items in
both full and summary views. Omit it for `notLoaded` views. Use the same
metadata for read, resume, and live turn snapshots.

Carry both lifecycle fields through the history projection, durable item
representation, store reads, and API conversions. Keep projection creation
time separate: if exposed as `createdAtMs`, document its fallback semantics
and provenance instead of labeling it a lifecycle start. Legacy replay must
associate available lifecycle events with the correct stable item IDs;
missing evidence remains null. Never substitute turn start, replay time, or
an ordinal. Any migration/backfill belongs inside Codex, through its supported
history handling, rather than requiring consumers to access its storage.

Upstream acceptance tests should cover two commentary items emitted hours
apart within one turn; cold read and resume; full/summary turn pagination;
item and timeline pagination; partial and legacy timing; duplicate updates;
stable IDs and timestamps across restart; rollback/fork handling; and seconds
versus milliseconds. Verify serialized responses and generated schemas,
including preservation of a known start when only a completion update arrives.
Release Codex with those changes before regenerating this package from that
exact released binary and following [PUBLISHING.md](PUBLISHING.md).

### Consumer integration now

Upgrading to 0.153.4 does not supply missing historical times. Capture live
`startedAtMs` and
`completedAtMs` by `(threadId, turnId, item.id)` and preserve those known values
when history refreshes. Treat locally observed receipt time as separate from
server lifecycle time. For cold history with no known item time, leave the
timestamp absent; use turn timing only to label the turn. Do not derive item
time from UUIDs, cursors, timeline positions, or turn boundaries.

After an upstream release implements the proposal, update the server binary
and matching type package together, consume the actual released field names,
and tolerate absent metadata from older servers. `thread/items/list` can
return JSON-RPC `-32601` for unsupported stores; keep a history fallback that
preserves unknown timestamps. No upstream issue or comment has been submitted.

## License

MIT © PwrDrvr LLC. The generated type definitions describe OpenAI's
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@pwrdrvr/codex-app-server-protocol",
"version": "0.144.0",
"version": "0.153.4",
"description": "TypeScript types for the Codex App Server JSON-RPC protocol, generated from `codex app-server generate-ts --experimental`. The package version mirrors the Codex CLI version used to generate it; the experimental protocol surface is included.",
"author": "PwrDrvr LLC",
"license": "MIT",
"type": "module",
"codexCliVersion": "0.144.0",
"codexCliVersion": "0.153.4",
"codexExperimental": true,
"keywords": [
"codex",
Expand Down
2 changes: 1 addition & 1 deletion src/AuthMode.ts
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" | "headers" | "agentIdentity" | "personalAccessToken" | "bedrockApiKey";
export type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "headers" | "agentIdentity" | "personalAccessToken" | "bedrockApiKey" | "bedrockAccessKeys";
Loading