Skip to content

Regenerate Codex app-server types from Codex 0.149.1 - #2436

Merged
SawyerHood merged 1 commit into
mainfrom
bb/regenerate-codex-app-server-types-thr_yd6yrwxywj
Aug 25, 2026
Merged

Regenerate Codex app-server types from Codex 0.149.1#2436
SawyerHood merged 1 commit into
mainfrom
bb/regenerate-codex-app-server-types-thr_yd6yrwxywj

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The vendored Codex app-server types under plugins/provider-codex/src/generated/codex-app-server/schema/ were last generated on 2026-08-17 and had drifted from the Codex CLI that bb now spawns (0.149.1). The stale types hid two real gaps: Codex emits ten server notifications that visibility.ts did not know about, and DynamicToolSpec became a tagged union upstream (0.143.0), so bb still sent the legacy untagged shape and only worked because Codex keeps a legacy-format normalizer.

What changed

  • Generated schema: regenerated with codex app-server generate-ts (stable surface, Codex 0.149.1) and re-pruned to the transitive import closure of the hand-written importers: 235 of the 663 emitted files (33 modified, 32 new, 1 dead file ThreadCompactStartParams.ts removed). The committed tree matched the stable surface byte-for-byte, and no hand-written code uses experimental fields.
  • visibility.ts: adds the ten new server notifications to both method maps as "unknown" (thread/deleted, thread/reverted, thread/queue/changed, thread/project/updated, thread/environment/{connected,disconnected}, project/changed, model/safetyBuffering/updated, autoApprovalReview/strictReviewRequired, externalAgentConfig/import/progress). Drops the manual "rawResponse/completed" union extension now that the schema includes it.
  • session-params.ts: toCodexDynamicTools emits type: "function". Verified against upstream source across bb's supported range: Codex 0.136.0 (CODEX_MINIMUM_SUPPORTED_VERSION) deserializes through a struct without deny_unknown_fields, so the extra field is ignored; Codex 0.149.1's normalize_dynamic_tool_specs accepts both the legacy and canonical shapes.
  • Test fixtures: new required fields (delivery on agentMessage, pluginId/scriptPath on commandExecution, appContext/readOnlyHint on mcpToolCall, results on webSearch, section/sectionEnteredAt/projectId/recencyAt on Thread, cacheWriteInputTokens, spendControlReached).
  • Generated README: names the current importers and package filter (it referenced adapter.ts and @bb/agent-runtime, which no longer exist) and records that the committed tree is the stable surface.

No HOST_DAEMON_PROTOCOL_VERSION bump: these types only cross the bridge↔Codex wire, not server↔daemon. No CLI or config surface changed.

Not wired up in this PR (flows through existing default paths): the new subAgentActivity and sleep item types and delivery: "async" agent messages. AskForApproval dropped "on-failure" upstream; nothing in bb used it.

How you verified

  • Before the hand-written fixes, pnpm exec turbo run typecheck --filter=bb-plugin-provider-codex failed with 36 errors against the new schema (missing notification methods, DynamicToolSpec shape, missing required fixture fields). After: green.
  • pnpm exec turbo run typecheck test --filter=bb-plugin-provider-codex --force: 24 test files, 238 tests pass. The toCodexDynamicTools test expectation now asserts the type: "function" tag.
  • EAP codename scan of the working tree (tracked and untracked) and HEAD: 0 hits.

Fixes #

AGENT GENERATED

Regenerate the pruned schema under plugins/provider-codex/src/generated
from the stable surface of codex app-server generate-ts (0.149.1).

The new types surface two real gaps in the hand-written code:

- visibility.ts: add the ten new server notifications to both method
  maps, and drop the manual rawResponse/completed union now that the
  schema includes it.
- session-params.ts: DynamicToolSpec is now a tagged union, so emit
  type: "function". Codex 0.136.0 (bb's minimum) ignores the extra
  field and 0.149.1 accepts both shapes via normalize_dynamic_tool_specs.

Test fixtures gain the new required fields. The generated README names
the current importers and package filter.

Co-Authored-By: Claude <noreply@anthropic.com>
@SawyerHood
SawyerHood merged commit 6210805 into main Aug 25, 2026
15 checks passed
@SawyerHood
SawyerHood deleted the bb/regenerate-codex-app-server-types-thr_yd6yrwxywj branch August 25, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant