feat: add Z.AI coding provider protocols #460

Open
nsaspy wants to merge 1 commit from feat/zai-provider-protocols into main
Owner

Summary

  • add first-class Z.AI Coding Plan constructors for Chat Completions, OpenAI Responses/Codex, and Anthropic Messages/Claude
  • preserve canonical tool-call correlation, native reasoning/thinking continuation order, structured outcomes, credential redaction, and explicit provider capabilities
  • make model-provider User-Agent identity configurable through validated user_agent/1 configuration while retaining prolog-rlm/0.1 as the default
  • document endpoints, credential handling, supported protocol behavior, and AgentProlog readiness

Runtime invariant

Provider configuration selects wire translation only. Credentials remain unresolved env/1 references until dispatch, malformed or non-ground wire data fails closed before network I/O, and descriptive client identity grants no capability or authority.

Non-goals

  • Responses and Anthropic streaming are not emulated; they return capability_denied until their native event protocols are implemented.
  • This does not claim provider-level exactly-once behavior or live Z.AI account/quota conformance.

Verification

  • focused provider tests: 43/43
  • loopback HTTP identity/protocol tests: 12/12
  • deterministic suite: 1,259/1,259
  • runtime and static-load checks
  • deterministic and deep-experiment benchmarks
  • CLI JSON demo smoke
  • git diff --check
  • prolog-verify check

Live Z.AI E2E was not run because no usable ZAI_API_KEY was available and live testing was explicitly declined.

## Summary - add first-class Z.AI Coding Plan constructors for Chat Completions, OpenAI Responses/Codex, and Anthropic Messages/Claude - preserve canonical tool-call correlation, native reasoning/thinking continuation order, structured outcomes, credential redaction, and explicit provider capabilities - make model-provider `User-Agent` identity configurable through validated `user_agent/1` configuration while retaining `prolog-rlm/0.1` as the default - document endpoints, credential handling, supported protocol behavior, and AgentProlog readiness ## Runtime invariant Provider configuration selects wire translation only. Credentials remain unresolved `env/1` references until dispatch, malformed or non-ground wire data fails closed before network I/O, and descriptive client identity grants no capability or authority. ## Non-goals - Responses and Anthropic streaming are not emulated; they return `capability_denied` until their native event protocols are implemented. - This does not claim provider-level exactly-once behavior or live Z.AI account/quota conformance. ## Verification - focused provider tests: 43/43 - loopback HTTP identity/protocol tests: 12/12 - deterministic suite: 1,259/1,259 - runtime and static-load checks - deterministic and deep-experiment benchmarks - CLI JSON demo smoke - `git diff --check` - `prolog-verify check` Live Z.AI E2E was not run because no usable `ZAI_API_KEY` was available and live testing was explicitly declined.
feat: add Z.AI coding provider protocols
Some checks failed
CI / REAL OpenRouter integration (pull_request) Has been skipped
CI / Deterministic unit and load checks (pull_request) Failing after 1m56s
Clean SWI pack install / Install and load copied pack (pull_request) Successful in 48s
Nix flake / Flake package and clean runtime load (pull_request) Successful in 5m47s
Paid OpenRouter / Pinned paid OpenRouter integration (pull_request) Failing after 6m32s
Tree-sitter FFI / Direct SWI-Prolog Tree-sitter FFI (pull_request) Successful in 4m34s
9362607c7c
Some checks failed
CI / REAL OpenRouter integration (pull_request) Has been skipped
CI / Deterministic unit and load checks (pull_request) Failing after 1m56s
Clean SWI pack install / Install and load copied pack (pull_request) Successful in 48s
Nix flake / Flake package and clean runtime load (pull_request) Successful in 5m47s
Paid OpenRouter / Pinned paid OpenRouter integration (pull_request) Failing after 6m32s
Tree-sitter FFI / Direct SWI-Prolog Tree-sitter FFI (pull_request) Successful in 4m34s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/zai-provider-protocols:feat/zai-provider-protocols
git switch feat/zai-provider-protocols

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/zai-provider-protocols
git switch feat/zai-provider-protocols
git rebase main
git switch main
git merge --ff-only feat/zai-provider-protocols
git switch feat/zai-provider-protocols
git rebase main
git switch main
git merge --no-ff feat/zai-provider-protocols
git switch main
git merge --squash feat/zai-provider-protocols
git switch main
git merge --ff-only feat/zai-provider-protocols
git switch main
git merge feat/zai-provider-protocols
git push origin main
Sign in to join this conversation.
No description provided.