Skip to content

fix(codex): the protocol generator runs again on Effect rc.115 - #13480

Merged
juliusmarminge merged 1 commit into
mainfrom
t3code/codex-generator-effect-rc115
Sep 24, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
t3code/codex-generator-effect-rc115

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

The Codex protocol generator no longer runs on main. The Effect rc.115 upgrade changed the JSON Schema importer, and node scripts/generate.ts in packages/effect-codex-app-server fails even at the pinned Codex ref, which blocks any Codex protocol bump.

$ node scripts/generate.ts        # main cdb26fe635
ERROR (#1): Error: Unsupported $ref "#/definitions/ApplyPatchApprovalParams__ThreadId". Use "#/$defs/Name".

$ node scripts/generate.ts        # this branch
INFO (#1): Generated Codex App Server schemas from 678157acaa819d5510adfe359abb5d0392cfe461

The importer changed in three ways:

  • It only resolves #/components/schemas/ refs for OpenAPI input. The generator now emits those instead of #/definitions/.
  • It imports an object with no additionalProperties as an open record (StructWithRest). Codex never declares additionalProperties for plain structs, so objects that list their properties are now closed and decode as plain structs, as before. Decoding still ignores unknown keys.
  • It refuses to intersect shared object fields with object alternatives. Codex uses that shape for "one of these keys plus shared fields" (for example image_url | file_id next to detail and type). The shared fields are folded into each alternative.

adaptSchemaForEffect handles the last two and only walks schema positions, so a field that is literally named properties (in the MCP elicitation schema) stays a field. The generator also reads GITHUB_TOKEN, because a full run makes more GitHub API calls than the anonymous 60/hour limit allows.

The bindings are regenerated at the same Codex ref, so the protocol is unchanged. Compared with the committed output, there are the same 1,895 exported schemas, the same 2 intentional open records (ConfigReadResponse config maps) and no Never types. The rest of the diff is formatting and identifier annotations from the newer Effect generator. It also types free-form JSON as Schema.Json instead of unknown, so the MCP elicitation response builder in CodexSessionRuntime.ts follows.

src/_generated/ is machine output. Review scripts/generate.ts and the CodexSessionRuntime.ts change; rerunning the generator on this branch reproduces the committed files with no diff.

Verification:

  • effect-codex-app-server tests: 36 passed.
  • Server Codex tests (adapter, session runtime, collab replay and wire, provider, driver, registry): 184 passed.
  • tsc --noEmit is clean for effect-codex-app-server and apps/server. Scoped lint reports no errors.

No UI changes, so there are no screenshots.

Bottom layer of a stack; #13481 bumps Codex to 0.156 on top of it.

🤖 Generated with Claude Code (Claude Opus 5.5, Claude Code harness)

Summary by CodeRabbit

  • Improvements
    • Schema generation now handles shared fields in alternative schemas, closes objects when additional properties aren’t specified, and uses updated schema references.
    • GitHub API requests are authenticated when a token is configured; other requests remain unauthenticated.
    • Elicitation defaults and submitted response content are now limited to JSON-compatible values.

The Effect rc.115 upgrade broke the protocol generator. The importer now
requires `#/components/schemas/` refs for OpenAPI input, imports objects
without `additionalProperties` as open records, and refuses to intersect
shared object fields with object alternatives. Regenerating failed even at
the pinned Codex ref.

Emit component refs, close objects that declare properties, and fold shared
fields into each alternative. The generator reads GITHUB_TOKEN so a full run
stays under GitHub's anonymous rate limit. Bindings are regenerated at the
same Codex ref; the newer generator types free-form JSON as Schema.Json, so
the MCP elicitation response builder follows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@juliusmarminge
juliusmarminge added this pull request to stack #13482 September 24, 2026 19:31
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Sep 24, 2026
@juliusmarminge juliusmarminge changed the title t3code/codex generator effect rc115 fix(codex): the protocol generator runs again on Effect rc.115 Sep 24, 2026
@github-actions github-actions Bot added the size:XXL 1,000+ changed lines (additions + deletions). label Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.5 KiB +7 B (+0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.0 KiB 7.1 KiB +3 B (+0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB +4 B (+0.1%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 56.3 KiB 56.3 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 10 10 0 (0.0%) 21 ✅
Claude Total thread wire 13.5 KiB 13.5 KiB −22 B (−0.2%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB −10 B (−0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.5 KiB 6.4 KiB −12 B (−0.2%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 9 9 0 (0.0%) 21 ✅

Baseline: 408ff8a · PR result: 9835ce5 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR fixes generator compatibility but adds GitHub bearer-token handling and regenerates broadly used protocol codecs through a nontrivial schema adaptation layer. Those authentication and runtime-schema impacts merit human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 6ed8a9f4-6362-4527-9fff-5880d982baa1

📥 Commits

Reviewing files that changed from the base of the PR and between cdb26fe and 9835ce5.

⛔ Files ignored due to path filters (1)
  • packages/effect-codex-app-server/src/_generated/schema.gen.ts is excluded by !**/_generated/**
📒 Files selected for processing (2)
  • apps/server/src/provider/Layers/CodexSessionRuntime.ts
  • packages/effect-codex-app-server/scripts/generate.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The pull request changes MCP elicitation values to JSON types. It also updates schema fetching, reference paths, and schema adaptation before generator registration.

Changes

MCP elicitation JSON types

Layer / File(s) Summary
Elicitation JSON type updates
apps/server/src/provider/Layers/CodexSessionRuntime.ts
The elicitation default and response content map now use JSON values instead of arbitrary values.

Generated schema handling

Layer / File(s) Summary
Fetch and resolve schema references
packages/effect-codex-app-server/scripts/generate.ts
GitHub API requests use a bearer token when GITHUB_TOKEN is set. Local and resolved external definition references now use #/components/schemas/.
Adapt aggregate schemas
packages/effect-codex-app-server/scripts/generate.ts
The generator adapts schemas after adding async-question fields and before registration. The adapter closes certain object schemas and merges shared object constraints into anyOf or oneOf alternatives.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to 9835c

The current protocol bindings do not exhibit the reported schema mismatch. This change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary change: restoring the Codex protocol generator after the Effect rc.115 upgrade.
Description check ✅ Passed The description explains what changed, why it changed, verification results, UI applicability, and generated-file scope. It does not reproduce the checklist headings, but it provides the required info…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge merged commit 567783e into main Sep 24, 2026
26 of 27 checks passed
@juliusmarminge
juliusmarminge deleted the t3code/codex-generator-effect-rc115 branch September 24, 2026 21:10
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 25, 2026
## What's Changed
* lint/unknown and static by @juliusmarminge in pingdotgg/t3code#13366
* fix(web): web colors come from theme tokens by @juliusmarminge in pingdotgg/t3code#13371
* fix(web): appearance classes use theme tokens and scale values by @juliusmarminge in pingdotgg/t3code#13397
* fix(server): keep Codex's reset answer when the re-probe fails by @juliusmarminge in pingdotgg/t3code#13363
* fix(mobile): branch search finds remote and space-typed branches by @Bil0000 in pingdotgg/t3code#13454
* chore(ci): use GPT 6 Sol Max for check agents by @juliusmarminge in pingdotgg/t3code#13473
* feat(server): show and redeem Claude banked resets by @Bil0000 in pingdotgg/t3code#13118
* fix(observability): a malformed OTEL_RESOURCE_ATTRIBUTES no longer stops startup by @yordis in pingdotgg/t3code#13469
* fix(antigravity): let Stop end commands that outlived their turn by @juliusmarminge in pingdotgg/t3code#13388
* fix(web,mobile): drop the baked-in tile from the Antigravity icon by @flamboh in pingdotgg/t3code#13373
* fix(marketing): use the official OpenCode and Antigravity logos by @flamboh in pingdotgg/t3code#13365
* fix(acp): keep one answer when a running tool reports progress by @juliusmarminge in pingdotgg/t3code#13386
* feat(web): run shell commands from chat in the thread terminal by @Bil0000 in pingdotgg/t3code#13060
* fix(antigravity): keep Windows runtime unpacking under MAX_PATH by @juliusmarminge in pingdotgg/t3code#13389
* fix(codex): the protocol generator runs again on Effect rc.115 by @juliusmarminge in pingdotgg/t3code#13480
* feat(codex): require Codex 0.156 and regenerate its protocol by @juliusmarminge in pingdotgg/t3code#13481
* feat(threads): add per-thread auto-settle switch by @t3dotgg in pingdotgg/t3code#11846
* fix(web): working and monitoring threads fade in the sidebar again by @t3dotgg in pingdotgg/t3code#13506
* fix(server): streamed section titles wait for the text under them by @t3dotgg in pingdotgg/t3code#13504
* fix(web): normalize disabled control opacity by @t3-code[bot] in pingdotgg/t3code#11441


**Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260924.2213...v0.0.43-nightly.20260924.2223

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260924.2223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant