feat(providers): add Z.AI Coding Plan with streaming tool calls (#12205)

Co-authored-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
James Dumay
2026-09-19 03:58:19 +00:00
committed by GitHub
parent d57c9a4d73
commit ba8ba0cadb
8 changed files with 427 additions and 2 deletions
@@ -91,6 +91,29 @@ goose supports [Agent Client Protocol (ACP)](https://agentclientprotocol.com/) a
See the [ACP Providers guide](/docs/guides/acp-providers) for detailed setup instructions.
:::
### Z.AI Coding Plan
In goose Desktop, open **Settings → Models**, choose **Z.AI Coding Plan**, and
enter your Coding Plan API key. The model selector discovers available models
from your Coding Plan endpoint; use **Refresh** to update the list.
Z.AI may list models that your subscription cannot use; access is checked when
you send a request.
In the CLI, select **Z.AI Coding Plan** in `goose configure` and supply your Coding Plan API key,
or set `GOOSE_PROVIDER=zai_coding_plan`, `GOOSE_MODEL=glm-5.3`, and
`ZAI_CODING_PLAN_API_KEY`. GLM-5.3 and GLM-5.3-Flash are the fallback choices
when the endpoint does not support model discovery.
This provider uses the dedicated OpenAI-compatible endpoint
`https://api.z.ai/api/coding/paas/v4`. It enables both `stream` and `tool_stream`
for streaming requests, including newly discovered models, so tool arguments arrive incrementally, and preserves
`reasoning_content` across tool-result turns. The existing **Z.AI** provider
continues to use the Anthropic-compatible endpoint.
See Z.AI's [Coding Plan model availability](https://docs.z.ai/devpack/overview),
[tool streaming](https://docs.z.ai/guides/capabilities/stream-tool), and
[thinking preservation](https://docs.z.ai/guides/capabilities/thinking-mode) documentation.
## Configure Provider and Model
To configure your chosen provider, see available options, or select a model, visit the `Models` tab in goose Desktop or run `goose configure` in the CLI.