Skip to content

fix(agent): support Codex evolution schemas - #111

Merged
Pepps233 merged 8 commits into
mainfrom
fix/codex-evolution-response-schemas
Aug 25, 2026
Merged

Pepps233 merged 8 commits into
mainfrom
fix/codex-evolution-response-schemas

Conversation

@Pepps233

@Pepps233 Pepps233 commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix Codex evolution schema compatibility and harden recursive reflection so each node preserves its transcript, leaf failures do not block synthesis, and default model/tool budgets cover the unfinished reflection DAG.

Reasoning

OpenAI Structured Outputs supports anyOf, while the existing schemas used unsupported constraints such as oneOf, const, and uniqueItems. The runtime parsers already enforce duplicate rejection and discriminator validity, so removing provider-side uniqueness constraints does not weaken persisted evolution data.

Reflection also restarted response refinement with a fresh transcript and used fixed job-wide limits of 100 provider calls and 200 tool calls. Recoverable tool denials could therefore repeat, leaf work could consume capacity needed for synthesis, and a terminal leaf could stop otherwise successful branches.

Changes

  • Remove uniqueItems from reflector and curator response schemas.
  • Replace curator oneOf branches with equivalent disjoint anyOf branches.
  • Replace fixed const values with singleton enums.
  • Validate response-tool and JSON-text submissions within one transcript-preserving executor invocation.
  • Retain assistant messages, tool results, recoverable denials, and unchanged transcripts across bounded transport retries.
  • Persist one fresh retry for retryable leaf failures or timeouts, then checkpoint terminal leaf outcomes without blocking sibling work.
  • Synthesize lessons from successful children, report unavailable children, and checkpoint empty synthesis branches without a model call.
  • Expose each evolution executor's bounded provider-call allowance.
  • Derive default model-call and tool-call envelopes from unfinished leaves, durable retry state, and synthesis nodes.
  • Refresh envelopes after durable retry transitions and node checkpoints, and reconstruct them after restart.
  • Keep explicit maxModelCalls and maxToolCalls as hard ceilings with required-versus-available diagnostics.
  • Add regression coverage for Codex schema compatibility, transcript preservation, leaf retry/partial synthesis behavior, 40-leaf budget derivation, explicit ceilings, and restart recovery.

User impact

  • Codex evolution requests reach inference with supported response schemas.
  • Recoverable evidence denials and invalid submissions can be corrected without losing node context.
  • Failed or timed-out leaves no longer discard successful sibling lessons.
  • Large reflection plans reserve capacity for all remaining leaf attempts and synthesis nodes instead of failing at the legacy fixed defaults.

Testing

  • node ../../node_modules/vitest/dist/cli.js --run test/reflector.test.ts test/curator.test.ts
  • node ../../node_modules/vitest/dist/cli.js --run test/evolution-runtime.test.ts
  • npm run check
  • ./test.sh
  • CI build-check-test

- Keep reflector and curator schemas within the Codex-supported JSON Schema subset
- Preserve duplicate rejection through application-side response validation
- Validate response-tool and JSON-text submissions before completing an executor invocation.
- Retain tool results across corrections and transport retries while isolating node conversations.
- Persist one fresh leaf retry with independent deadlines, transcripts, tools, and terminal diagnostics.
- Synthesize successful child lessons past unavailable or empty branches and report skipped coverage.
- Publish each executor's bounded provider-call capacity.
- Cover the coding-agent executor allowance in runtime tests.
- Reserve model and tool capacity for unfinished leaf attempts and synthesis nodes.
- Rebuild envelopes from durable checkpoints and fail fast on undersized ceilings.
- Remove evolution entries added by this pull request.
- Keep generated release records unchanged.
@Pepps233
Pepps233 merged commit cf7676b into main Aug 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant