Skip to content

feat: add Zen Free model provider plugin - #2

Merged
baranwang merged 9 commits into
mainfrom
codex/zen-free-provider
Oct 19, 2026
Merged

baranwang merged 9 commits into
mainfrom
codex/zen-free-provider

Conversation

@baranwang

@baranwang baranwang commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Add packages/zen-free/, a model provider users enable in Godwit without entering an API key or manually creating model services.

  • Discover current free OpenCode models and select each model's protocol from upstream metadata. Support Chat Completions, Responses, Anthropic Messages, and the verified free Jev SystemOne judge.
  • Use the model API merged in feat: plugin models through Godwit's SDKs (replaces #108) godwit#109. prepareRequest takes modelId, method, URL, headers and the SDK's JSON text; the plugin returns the adapted URL, headers and JSON text. Generation and response parsing remain in the host's SDKs.
  • Keep public credentials, OpenCode-compatible headers, identifiers and placeholder tools in the plugin. One Zen session is generated per plugin instance, with a new identifier for every request. Placeholder definitions register no executable tools.
  • Use package name @godwit/plugin-zen-free and SDK dependency @godwit/sdk@^1.7.0. The runtime bundle has no external dependencies or sibling repository imports.
  • One shared Bun workflow discovers packages/*, runs type checks/tests/builds, and prepares per-plugin artifacts and release metadata. The goja integration test lives alongside the plugin and uses exported host APIs; it needs no host source changes, frontend installation or code generation.
  • Keep the plugin README focused on users. Maintainer release steps live in the repository README.

Release dependency

Godwit #109 is merged. The published app and SDK 1.6.0 predate that API; Godwit #111 prepares 1.7.0. Source CI packs the SDK from the merged host commit 95eb0180654353e4e0a026a33258d6f9f0c6fb54; release CI requires the published SDK.

This PR does not publish a plugin release or modify registry.json. After a compatible host/SDK release and resolution of the stream issue below, publish the plugin and submit its generated registry entry through the existing validation/signing workflow.

Validation

  • 14 Bun tests pass, including actual goja loading, listing, model-to-protocol routing, request adaptation for all three generation protocols and SystemOne, and release metadata checks.
  • Type checking, bundle build, actionlint and git diff --check pass.
  • Current live acceptance against the #109 API: discovery listed 10 free models; Big Pickle text generation and Jev judge passed. Only fixed public test prompts and an inert zen_echo tool were used.
  • Responses and Anthropic were checked with local fixtures; live calls for those protocols were not repeated.

Remaining host SDK issue

Live Big Pickle tool acceptance failed when the stream contained a legal SSE comment heartbeat (: keep-alive followed by a blank line). The host's current openai-go decoder treats that comment-only event as an empty JSON response and returns unexpected end of JSON input; the engine reports an unusable response. This can affect any Chat Completions request containing such a heartbeat.

The same captured public-test response was replayed offline through openai-go: unchanged, it failed before decoding any chunks; with only the initial comment heartbeat removed, all 15 chunks decoded successfully. The response contained the expected zen_echo call and [DONE].

The plugin API adapts requests only. A fix belongs in the shared host SDK/protocol path. No response parser or host workaround is added in this plugin PR; live tool acceptance remains blocked on that fix.

Discover current free OpenCode models and adapt model-specific protocols through the Godwit models API.

Co-authored-by: Codex <noreply@openai.com>
Replace sibling-repository imports with @godwit/sdk, add strict type checking, and document tarball validation before the first SDK publication.

Co-authored-by: Codex <noreply@openai.com>

Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T17:52:34.324786Z ccc96e6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: ccc96e65ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

baranwang and others added 7 commits October 18, 2026 01:57
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@baranwang
baranwang merged commit 0ee0a20 into main Oct 19, 2026
4 checks passed
@baranwang
baranwang deleted the codex/zen-free-provider branch October 19, 2026 01:47
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