Skip to content

review-only: openai-client 0.3.0 regen diff (do not merge — repo is retiring) - #2

Draft
ggreif wants to merge 1 commit into
mainfrom
review/0.3.0-regen-diff
Draft

ggreif wants to merge 1 commit into
mainfrom
review/0.3.0-regen-diff

Conversation

@ggreif

@ggreif ggreif commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review only — please do not merge. This repo is being retired; the branch
exists so the final regen is reviewable here, next to the history it belongs
to.

openai-client has moved to
caffeinelabs/skills-internal
under packages/connectors/openai, alongside x, weatherapi, slack, twilio,
googledrive and the Google family. 0.3.0 is published from there
(skills-internal#292), so nothing needs to land in this repo.

The diff

118 files, +1244 / −1400. Generated by openapi-generator 7.24.0 + the Motoko
plugin (was 7.22.0), against the same spec and the same focusApis subset — so
no model is added or removed, only regenerated: 114 files under src/, plus
mops.toml, mops.lock, README.md, .openapi-generator/VERSION.

0.2.5 0.3.0
generator 7.22.0 7.24.0
moc 1.4.1 1.6.0
core 2.4.0 2.6.0
serde-core 0.1.4 0.2.1 (de-based)
extra pins cbor, itertools, base, xtended-numbers, sha2 none — vendored by serde-core
is_replicated caller's job ?false in defaultConfig

Worth a reviewer's attention

is_replicated = ?false is a correctness and cost fix here, not a tweak. A
replicated outcall issues the request once per replica: OpenAI bills ~13×, the
Authorization: Bearer sk-… header crosses 13 independent TLS connections, and
sampled completions can never agree byte-for-byte, so consensus fails anyway.

The generator config's "12 of 220 moc --check failures" note was stale —
correcting what an earlier revision of this description said. Both sanitiser
fixes landed in 061160a, before 0.2.5 was cut, so this repo's HEAD already
had them:

  • the invalid variant tag #_[Int] now renders as #one_of_2 / #_Int_
    (CreateCompletionRequestPrompt, CreateEmbeddingRequestInput);
  • OpenAI's slash keys (hate/threatening, self-harm/intent) now render as
    hate_threatening, self_harm_intent (the three moderation models).

I typechecked this repo's main under its own pinned toolchain (moc 1.4.1 /
core 2.4.0 / serde-core 0.1.4): 220 passed, 0 failed — identical to 0.3.0.
So the regen changes no compile outcome; the note simply outlived the fix.

What is still broken — read before upgrading. Converters for a generic
oneOf are stubbed with Runtime.unreachable(): branches of mixed kinds
(Text | [Text] | [Int] | [[Int]]) cannot dispatch through one module. Those
files typecheck and trap on the first real request. 0.2.5 ships
byte-identical stubs
, so this is not a regression — these APIs have never
worked in any published version.

API 0.3.0
Chat, Images, Models, Files ✅ work
EmbeddingsApi, ModerationsApi ❌ always trap — input is required
CompletionsApi ❌ traps whenever prompt is set
AudioApi transcribe / translate ❌ always trap — the response decode is stubbed
Chat with tool_choice / function_call ❌ trap if set; null is safe

extension-openai 0.1.4 documents exactly this and steers builds onto the Chat
path; implementing the converters is a separate job in the generator repo.

After this

The package history stays reachable two ways once the repo goes: mops serves
every published version (0.2.5's tarball keeps its src/, README.md,
LICENSE, SKILL.md), and the git history — including CHANGELOG.md,
.github/, and the .openapi-generator/ provenance that mops does not ship —
is preserved in a local clone.

🤖 Generated with Claude Code

Courtesy diff for the last release of this repo, so the change is reviewable
here before the repo is retired. openai-client now lives in
caffeinelabs/skills-internal under packages/connectors/openai, and 0.3.0 is
published from there.

Generated by openapi-generator 7.24.0 + the Motoko plugin (was 7.22.0), against
the same spec and the same focusApis subset — so no model is added or removed,
only regenerated: 114 files under src/, plus mops.toml, mops.lock, README.md
and .openapi-generator/VERSION.

What a reviewer should look for:

- deps move to serde-core 0.2.1 / core 2.6.0 / moc 1.6.0, and the five
  transitive pins (cbor, itertools, base, xtended-numbers, sha2) disappear
  because serde-core 0.2.1 vendors them;
- `defaultConfig.is_replicated` becomes `?false`, which for this API is a
  correctness and cost fix, not a tweak: a replicated outcall bills OpenAI once
  per replica (~13x), sends the bearer over 13 TLS connections, and cannot
  reach consensus on sampled completions;
- the two sanitiser bugs this repo's clients tripped over are fixed upstream —
  the invalid variant tag `#_[Int]` now renders as `#one_of_2` / `#_Int_`, and
  OpenAI's `hate/threatening` style keys as `hate_threatening`, so all 220
  files typecheck where 12 used to fail;
- still NOT fixed, and worth knowing before anyone upgrades: converters for a
  generic `oneOf` remain stubbed with `Runtime.unreachable()`, so Embeddings,
  Moderations, Completions and Audio transcribe/translate now compile and then
  trap on the first request. Chat, Images, Models and Files are clean.

Not for merging: the repo is going away, and mops already serves 0.3.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ggreif ggreif self-assigned this Sep 18, 2026
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