Changelog
Notable changes to this project, loosely following
Keep a Changelog. Entries before v0.1.0 are
grouped by date; from v0.1.0 on, sections are tagged.
2026-08-03 (post-v0.1.0)
Fixed
- Streaming span lifecycle for observability hooks. The OTel/
Hookseam created a per-attempt span insideconnectChatStream/connectAnthropicStreambut never propagated it into the stream context, soOnStreamChunkrecorded nothing and the span was never ended on clean stream completion (unfinished spans leaked to the exporter). The attempt context now flows through to chunk hooks, clean completion firesOnResponse(ending the span), mid-stream errors attribute to the captured span, andAttemptis correctly populated on chunk/error hooks instead of being stamped0. Regression-tested (pkg/client/stream_test.go). extractUsagemissed embeddings and async results.usageBearerwas implemented only by*ChatResponse, soOnResponsehooks receivedUsage: nilfor embeddings and async (image/video) responses — token usage was invisible to tracing/metrics for those endpoints.EmbeddingsResponseandAsyncResultResponsenow implementGetUsage().NewOTelHookWithProviderpanicked on a nil provider. The comment claimed a nilMeterProvider/TracerProvideryielded a no-op and "never panics," but passing a literalnildereferenced a nil interface. Both args now fall back to the global no-op provider when nil.pkg/observe:errors.Assimplification. The manual**APIErrorunwrap chain was replaced with a plainerrors.As(err, &ae)(the prior comment's claim thaterrors.Asdoesn't type-match**Twas wrong).- Accounts-store path was wrong in the docs. The docs said
~/.config/go-z-ai/accounts.json; the code (intentionally, for upgrade compat) uses~/.config/zai-client/accounts.json. Docs now match the code. - Dead link in CONTRIBUTING. A 404
sitegenURL was replaced with a neutral note that the markdown underdocs/is the source of truth. - Langfuse overclaim removed. Docs and code comments referenced Langfuse
as a
pkg/observeimplementation; only OpenTelemetry ships. Corrected indocs/en/library-guide.md,pkg/client/hook.go,pkg/client/client.go. - Examples corrected.
quickstart-visionno longer falsely claims the client auto-base64-encodes local files (it passes URLs verbatim);audio-ttsrequestswavexplicitly (the API default is raw PCM) and names its output accordingly;observabilityno longer overclaims metrics (metrics are emitted only when aMeterProvideris registered);quickstart-structuredhandles its marshal error;chat-toolscomment reworded. - Compliance/usage-policy warning ported to all translated READMEs (de/ru/zh/tr/tt); previously it existed only in the English README.
- Locale README switchers now consistently link back to the English README and bold the current language.
.github/ISSUE_TEMPLATE/bug_report.ymllabel updated from the legacyzai-clientname togo-z-ai.
Changed
examples/README.mdnow documents all twelve example programs instead of four, and no longer tells readers that tools/vision/structured-output examples live "in the Library Guide" when they exist inexamples/..github/SETUP.mdcorrected to reference theAnnouncementsDiscussion category (matching.goreleaser.yml'sdiscussion_category_name), notReleases..github/workflows/ci.ymlcoverage-floor comment corrected: it referenced nonexistentpkg/agent/pkg/mcppackages; now mentions onlypkg/observe.Makefilecleantarget also removes the localsitegenbinary.
Removed
- Committed
sitegenbinary (12.7 MB) and generatedsite/tree removed from version control. They were introduced by the "extract sitegen to a standalone repo" commit, which deleted the generator source but accidentally left the build artifacts tracked. The/sitegenandsite/.gitignorerules are restored; the files remain on disk for local use.
Security
go.opentelemetry.io/otelbumped v1.40.0 → v1.41.0 to fix GO-2026-5506 (multi-value baggage header extraction causes excessive allocations — a DoS vector in code paths that propagate incoming baggage headers). All six otel module paths bumped in lockstep.
2026-08-02 (post-v0.1.0)
Fixed
- Monitor usage window was timezone-shifted. The
usage model-usage/tool-usageendpoints exchange zoneless time strings that the server interprets as its own wall-clock (verified live to be CST / UTC+8), but the client formattedstartTime/endTimein the viewer's local zone. Soaccounts usage --today/--daysrequested a range shifted ~6h and returned the wrong slice. The client now formats the query window in the server's timezone, so the requested absolute range is correct regardless of the viewer's zone.
Changed
- Usage/quota times render in the viewer's local timezone, with the
server's zone shown additionally when it differs. Reset times gain a
Server:line (the boundary that actually clears a limit) only when the server zone differs from local; theaccounts usageheat-map header converts its span to local time and prints a one-line note naming the server zone. The returnedx_timebucket labels (server-local, zoneless) are converted to local for display. Config.MonitorTimezone/--monitor-timezone/ZAI_MONITOR_TIMEZONEoverride the server-timezone assumption (default CST/UTC+8). Accepts IANA names (Asia/Shanghai),UTC,local, or offsets (+8,UTC-05:00).Client.MonitorTimezone()exposes the resolved zone so render layers can relabel.pkg/client.ParseTimezoneis the shared parser.
2026-07-19 (post-v0.1.0)
Added
- Observability hooks (
pkg/client/hook.go): a stdlib-onlyHookinterface (OnRequest/OnResponse/OnError/OnStreamChunk) attached viaConfig.Hooks. Fires on every request/response/error/stream-chunk through the centralizeddoRequestfacade and the new streaming iterators. Empty by default — the no-hook path is zero-allocation.RequestMetacarriesService/Method/Endpoint/Model/Attempt;ResponseMetaaddsStatusCode/Duration/Usage. Services stampService/Modelinto the context via the publicWithService/WithModelhelpers; the facade reads them back when building metadata. pkg/observepackage — concrete OpenTelemetry hook (OTelHook) emitting GenAI semantic-convention spans and metrics: one span per request attempt (retries produce N child spans), gen_ai.system=z.ai, request/response model, HTTP status, token-usage counters (input/output, by model), request-duration histogram, request-count by status. First public package with third-party deps (go.opentelemetry.io/otel v1.40.0); pkg/client stays stdlib-only. Construct viaobserve.NewOTelHook(serviceName)(uses global providers) orNewOTelHookWithProvider(...)for isolated/test setups.examples/observability— end-to-end demo wiring OTelHook onto a client and streaming a chat completion with stdout span export.- Iterator-based streaming (
pkg/client/stream.go):ChatService.Stream(ctx, req) iter.Seq2[StreamChunk, error]andAnthropicService.Stream(ctx, req) iter.Seq2[AnthropicStreamEvent, error], compatible with Go 1.23+'s range-over-func. The recommended streaming API going forward. Producer goroutine + buffered channel adapts the existing SSE parsers (readSSE,readAnthropicSSE) toiter.Seq2; context cancellation tears down the in-flight stream without leaking the producer. Connect-phase retry/backoff is preserved verbatim (extracted intoconnectChatStream/connectAnthropicStream, shared by both APIs). - Curated model catalog (
pkg/client/models_catalog.go) — the single source of truth for the model metadata/modelsdoes not return (context window, max output, pricing, capabilities, family/tier, release date, description). 15 models spanning GLM-5.x/4.x/OCR.ModelDetailsgains enrichment-only fields (MaxOutput,Family,Tier,Capabilities,CatalogName,CatalogDescription).GetTextModels/GetVisionModels/GetFreeModelsswitch from substring heuristics toHasCapability/IsFree. CLI gains FAMILY/CONTEXT/MAXOUT/CAPS columns; TUI gains a detail view (Enter on any model). Pricing/context transcribed fromdocs.z.ai/guides/overview/pricing(verified 2026-07-19, noted in source). Live API values always win when present, so the day Z.AI starts sendingmax_contextor pricing in/modelsthe real numbers take over. - Identifying
User-Agentheader on every request (go-z-ai/<version>), overridable viaConfig.UserAgent. Compliance hygiene under Z.AI's coding- endpoint usage policy (which prohibits unidentified SDK access). pkg/client.Version()andpkg/client.UserAgent()exports — library-visible version populated by GoReleaser ldflags (-X github.com/SamyRai/go-z-ai/pkg/client.version=x.y.z). Defaults to"dev"for from-source builds. Enables downstream feature detection and identifier reuse.
Deprecated
ChatService.CreateStreamandAnthropicService.CreateStream(the callback-based streaming APIs) — replaced byStream(iter.Seq2). The deprecated variants delegate toStreamso existing callers keep working unchanged; both will be removed in v1.0. All internal callers (CLIchatandanthropicsubcommands, TUI chat stream) migrated toStream.
Fixed
- TUI overlay
placeOverlaywas built but never applied. The variable was constructed and trimmed but never passed tolipgloss.Place; now wired. Makefile:LYCHEE_FLAGSnow includes--exclude 'localhost'so localmake docs-lintmatches CI (the parity the comment claimed but didn't deliver).docs/en/architecture.md: collapsed two MD012 double-blank-line runs and stripped trailing whitespace at EOF.internal/tui/models/detail.go:fmt.FprintfoverWriteString(fmt.Sprintf(...))per staticcheck QF1012.
2026-07-19
Open-source readiness pass: community files, examples, CI hardening, and the
first tagged release path. The local .env (never in git history) remains
gitignored — no keys were exposed or rotated.
Added
CODE_OF_CONDUCT.md(Contributor Covenant 2.1) with a contact address matchingSECURITY.md.README.zh.md— Simplified-Chinese README mirroring the English structure, with cross-language links at the top of both READMEs.examples/— three runnablepackage mainprograms (compiled by CI'sgo build ./...) covering the three core API shapes:examples/chat-streaming—Chat().CreateStreamcallback streaming.examples/async-poll—Images().GenerateAsync+WaitForResult.examples/anthropic-messages— the Anthropic-compatible/v1/messages. Each has a per-example description and is linked from the top-level README.
Makefilewrapping the contributor commands (build,vet,test,test-cover,fmt,fmt-check,lint,vuln,tidy,ci-local).--versiononzai-client(nowgo-z-ai), populated by GoReleaser ldflags at release time (version,commit,datevars inmain.go)..github/workflows/release.yml+.goreleaser.yml— tag-triggered (v*) GoReleaser build forlinux/amd64, linux/arm64, darwin/amd64, darwin/arm64, with SBOM (spdx-json) and keyless cosign/sigstore signing via OIDC. Creates a GitHub Release with an auto-generated changelog and publishes to theReleasesDiscussion category.- README: "How it relates to the official SDKs" section noting there is no
official Go SDK (Python/Node/Java only), and a callout that
zai-claude-config.jsonis a template, not a real config.
Changed
- CI hardening (
.github/workflows/ci.yml):- Added
concurrencyblock — cancels superseded PR runs. testandlintjobs now run on an OS matrix (ubuntu-latest,macos-latest) since the project ships a darwin binary and a TUI.- Tests now produce a coverage profile (
go test -race -coverprofile) and uploadcover.outas an artifact; a coverage summary is printed. - Pinned
govulnchecktov1.1.4instead of@latestfor reproducibility.
- Added
.gitignorenow covers.zcode/and.claude/at the repo level (previously.zcode/was covered by nothing and.claude/only by a per-developer global ignore — both are local agent/CLI working state that must never ship).
Documentation
- README docs table now links to
CODE_OF_CONDUCT.md. - Note on the global-vs-China endpoint feature matrix in
docs/accounts-and-quota.mdconfirmed already accurate for mid-2026 (embeddings/moderations/rerank/batch/voice onopen.bigmodel.cnonly; the GLM-5.2 flagship model is supported; the deprecated Assistant API is deliberately not implemented — seedocs/roadmap.md).
Security (no incident)
- Verified via
git log --all --full-history -- .env(empty) and a source scan for the Z.AI key format that no credentials were ever committed. All VCR cassettes carryBearer REDACTED. No key rotation was needed; the local.envstays ignored.
Changed (follow-up)
- Replaced the Go Report Card badge with OpenSSF Scorecard in both
READMEs. goreportcard.com sunset its public badge service on
July 1, 2026 (after 11 years); the badge endpoint now serves a static
"retired" placeholder for every repo, so the badge had become meaningless.
Added
.github/workflows/scorecard.ymlrunningossf/scorecard-actionweekly and onbranch_protection_review, uploading SARIF to the Security tab and exposing the score viaapi.securityscorecards.dev. SETUP.md updated accordingly.
2026-07-18
Added
- Regional gateway selection (
Config.Region/--region/ZAI_REGION). Z.AI serves the same GLM model family from two regional gateways: the international hostapi.z.ai(the historical default) and the China mirroropen.bigmodel.cn. Previously only Embeddings/Moderations were wired to the China host; monitor (quota/usage), biz (account info), agents, and account detection were hardcoded toapi.z.ai, so aglm_coding_plan_chinakey couldn't reach its own region's usage/account endpoints and got mis-classified byaccounts add/account detect.Config.Region(RegionGlobal, the default, orRegionChina) now selects the host for monitor, biz, agents, and detection. From the CLI:--region {global,china}orZAI_REGIONenv (aliasescn,bigmodel,west); an unknown value falls back to global rather than erroring.internal/coding/plans.gomirrors this withMonitorBaseURL/BizBaseURL/AgentsBaseURLplan helpers. The China hosts areNOT VERIFIED LIVE(modeled by mirroring theapi.z.aipath layout onopen.bigmodel.cn, which is live-verified for/modelsand/chat/completions). Seedocs/architecture.md. - Chat-completion API sync (
pkg/client/types.go,chat.go). New fields matching the current docs.z.ai chat-completion spec, all additive andNOT VERIFIED LIVEuntil a cassette pins them:ChatRequest.StreamToolCall— streamed tool-call deltas (GLM-4.6+).Toolnow discriminates acrossfunction/retrieval/web_searchtypes viaNewFunctionTool/NewRetrievalTool/NewWebSearchTool. Theweb_searchpayload shape ({"search_query":[...]}) follows the official Python SDK example;retrievaland the full tool-type support are unverified live.ChatResponse.WebSearch— the top-levelweb_searcharray returned when a web_search tool fires (entry shape reusesWebSearchResultfromtools.go).ThinkingConfig.Effortnow documentsxhigh(GLM-5.2;xhigh→max).validateChatRequestrejects unknown effort values client-side.FinishReason*constants for the live valuessensitive,model_context_window_exceeded,network_error.- Client-side tool-name guard (
^[A-Za-z0-9_-]{1,64}$), a 128-function cap, and per-type payload validation (afunction/retrieval/web_searchtool must carry its matching payload; unknown types are rejected).
- Live-verification scaffolding for four more services in
pkg/client/live_verify_test.go: Voice Clone, Voice Delete, Chat-Stream-Tool-Call, and Chat-Web-Search-Response. Each skips until a cassette exists (CI stays green); record one withZAI_RECORD=1 ZAI_API_KEY=<key> go test -run TestVerify<Name> ./pkg/client(the harness redactsAuthorizationtoBearer REDACTEDbefore saving).
Docs
- Aligned every doc with the 2026-07-18 sprint:
--region/ZAI_REGIONadded to the CLI Reference global-flags table;xhighadded to the--effortvalues;Config.Regionadded to the Library Guide Config table; the new tool types (NewRetrievalTool/NewWebSearchTool),StreamToolCall,ChatResponse.WebSearch, theFinishReason*constants, the 128-function cap, and the tool-name regex documented in the Library Guide's Function calling section; Accounts & Quota's "China platform key" rewritten as "Regional gateways" covering both the Embeddings/Moderations axis and the monitor/biz/agents/detection axis; Getting Started's China note reframed; Architecture's "three services" corrected to four (detection also went region-aware). - Rewrote
docs/roadmap.mdas a crisp, current task list — every "Unverified live" item names its exactTestVerify*test + recording command, grounded in the cassette inventory (no item was removed: none of the unverified services got a success cassette this sprint). - Renamed
pkg/client/live_verification_test.go→live_replay_test.goso the two live-test files self-document:live_replay_test.goholds theTest*Livereplay-only tests (frozen findings),live_verify_test.goholds theTestVerify*recording harness. No behavior change. - Index completeness:
docs/README.mdnow lists.github/SETUP.mdand.env.example; rootREADME.md's doc table now matches the docs/ index (Roadmap, Security, Changelog rows added). .github/PULL_REQUEST_TEMPLATE.mdchecklist aligned with CONTRIBUTING.md (addedgolangci-lint runandgovulncheck).
2026-07-17
Changed
- Repository layout (breaking for importers of the app packages). The CLI
command code moved from
package mainat the repo root intointernal/cli(a five-line rootmain.gonow just callscli.Execute()), and the in-repo-only packagespkg/tui,pkg/usageview,pkg/accounts, andpkg/codingmoved underinternal/. Onlypkg/clientremains a public, importable package — the documented library surface is now compiler-enforced.go install github.com/SamyRai/go-z-ai@lateststill produces thego-z-aibinary; CLI behavior and--helpoutput are unchanged. If you importedpkg/accountsorpkg/codingdirectly (previously documented as reusable), that import path no longer exists — drive the functionality through theaccounts/codingCLI commands instead. interface{}→anythroughout (mechanical;anyis an alias, sopkg/client's exported signatures are unchanged for consumers).
Added
- Consistent
--format text|jsonon every result-producing command.batch,files,image,video,rerank, andocrgained JSON output (were text-only);embeddings/moderationskeep JSON as the default but gained a text summary. Progress messages on JSON-capable commands now go to stderr so stdout stays valid JSON. - First tests for the CLI layer: credential-precedence coverage
(
resolveConfig), an end-to-end cobra harness againsthttptest, and unit tests forbuildChatRequestand the newinternal/fileinputhelper.
Internal
runWithClientwrapper replaces the four-linegetClientpreamble repeated across ~50 command handlers.addFormatFlag/emithelpers centralize output formatting.internal/fileinput.FileOrURLde-duplicates the OCR file/URL handling previously copied betweenocr parseand the TUI media tab.
Fixed
accounts list/show/current --format jsonmasked the API key like the table view does (it previously printed the raw key);--revealopts into raw keys for export/backup.usage/account status now correctly reports an insufficient-balance account as accessible but out of balance instead of inaccessible. It classifies the failure from the structured*APIError(code/HTTP status) rather than string-matching a message; distinguishes 401 (auth) and 429 (rate limit) too.- TUI: submitting a media job (esp. a multi-minute video) and switching tabs no longer strands the result — async results are routed back to the originating tab, with esc-to-cancel.
Testing / docs
- First unit tests for the credential store (
internal/accounts), every TUI tab, and the CLI credential-precedence path. New opt-in live-verification harness (ZAI_RECORD=1) records redacted cassettes for previously docs-only success shapes (Anthropic Messages, Embeddings, Moderations, Agents). Noted the vision + tool-calling 401 pitfall in the CLI reference.
2026-07-12
Added
- Quota burn-rate ("Pace") indicator on token windows in
accounts quota/usage quotaand the TUI Usage tab: extrapolates each rolling window's own reported usage against elapsed window time to flag when you're on pace to run out before reset (62% used at 55% of window elapsed — on pace to run out ~24m before reset). Straight-line math on real API fields — no peak/off-peak pricing assumptions. NewQuotaLimit.WindowDuration()/WindowStart()andusageview.Pace/FormatPace(the first tests for the previously untestedusageviewpackage). Directly targets the common "limits run out sooner than expected" complaint. - Anthropic-compatible Messages client (
AnthropicService,c.Anthropic()) — a typed Go client for Z.AI's/api/anthropicsurface (POST /v1/messages), the endpoint the GLM Coding Plan points Claude Code at, parallel to the OpenAI-styleChatservice. CoversCreate, streamingCreateStream(raw Anthropic SSE events), text/image/tool_use/tool_result content blocks, tools (with the same schema-compat rewrite), and Bearer auth +anthropic-versionheader. New CLI:anthropic messages <prompt> [--stream ...]. Routing/auth are confirmed reaching the live endpoint (bogus key → clean HTTP 401); the success-path body shape is documented, not yet live-verified (see Roadmap).- Extended thinking:
AnthropicThinkingrequest config,thinking/redacted_thinkingresponse blocks, andresp.Thinking()— which falls back to an OpenAI-stylereasoning_contentfield if GLM surfaces reasoning that way instead of as a thinking block (the claude-code-router#1133 case). CLI--thinking-budget Nenables it and prints reasoning to stderr.
- Extended thinking:
- Tool-schema compatibility: chat requests now normalize tool (function)
parametersinto the flat JSON-Schema subset GLM's parser accepts, instead of lettinganyOf/oneOf/allOf/$ref/$defsreach the endpoint and come back as an opaque HTTP 500 (a pain point for tools generated from typed languages — nullable fields, reused structs, composed types). Nullable unions collapse to their underlying type,allOfmerges, and local$refs inline (with cycle protection). Exposed asclient.SanitizeToolSchemasfor explicit use, applied automatically before every chat request, and disablable viaConfig.DisableToolSchemaCompat. Seepkg/client/toolschema.goand Library Guide. The exact set of server-rejected constructs is drawn from community reports, not yet reproduced live here (see Roadmap). coding mcp add/remove/status: registers Z.AI's official Vision MCP Server (@z_ai/mcp-server— screenshot OCR, error-screenshot diagnosis, diagram/chart understanding, image/video analysis via GLM-4.6V) into any of the five supported coding tools, matching the "manage MCP services" step of the official@z_ai/coding-helperwizard that this client otherwise ports in full. Each tool gets its correct file and JSON shape — notably, Claude Code and Factory Droid keep MCP config in a different file than their provider/credential config. Available from the CLI and the TUI's Coding tab (mkey).
Changed
- golangci-lint is now part of the gate: a checked-in
.golangci.yml(default linter set — errcheck, govet, ineffassign, staticcheck, unused), agolangci-lintCI job on every push/PR, and a line in the CONTRIBUTING pre-PR checklist. The config deliberately keepsio.Reader.Readchecked so the short-read pattern below can't come back unnoticed.
Fixed
- Short-read bug in test HTTP servers — a single
r.Body.Readinto aContentLength-sized buffer (Readisn't guaranteed to fill the buffer in one call, so body assertions could flake). A first pass fixed four files; golangci-lint then surfaced eight more occurrences across the moderations, rerank, tools, voice, and layout tests, now all onio.ReadAll. staticcheckSA9003 emptyifbranch inmain.go's config load, collapsed to the same_ = ...idiom already used for the.envload above it.
2026-07-11
Added
- Agents service (
Invoke,AsyncResult) — live-verified, including the 200-with-embedded-business-failure response quirk both endpoints share. - Embeddings, Moderations, Rerank, Voice (cloning), and FileParser services and CLI commands.
- Handwriting OCR (
ocr handwriting), distinct from layout parsing (ocr parse). - A go-vcr-based live-verification test
suite (now
pkg/client/live_replay_test.go+live_verify_test.go,testdata/cassettes/) that replays real recorded API interactions instead of hand-written fixtures. - Cursor as a fifth supported coding tool alongside Claude Code, OpenCode, Crush, and Factory Droid.
- Full documentation rewrite: a
docs/guide (Getting Started, CLI Reference, Accounts & Quota, Coding Tools, Library Guide, Error Handling, Architecture),CONTRIBUTING.md,SECURITY.md, this changelog, and a CI workflow (build/vet/gofmt/test -race/govulncheck).
Changed
- Module path renamed to
github.com/SamyRai/go-z-ai(was the non-installablezai-api-client) ahead of the public release. - Licensed under Apache 2.0.
pkg/coding's API-key validator no longer mutateshttp.DefaultClient(a shared global) — it now bounds the request withcontext.Contextinstead, fixing a data race under concurrent callers (the TUI validates keys from a background goroutine).- Config-file writers in
pkg/coding(the credential store and every third-party tool config it edits) now write atomically via temp-file-then-rename, matching the patternpkg/accountsalready used — a crash mid-write can no longer truncate your Claude Code/OpenCode/Crush/ Factory Droid/Cursor settings. - Resource IDs (
batchID,fileID, task IDs) are now URL-path-escaped before being interpolated into request paths. - Removed unused "legacy compatibility" error constructors/sentinels from
pkg/clientthat had no real callers anywhere in the codebase.
2026-07-10
Added
- Streaming chat completions (SSE), with CLI
chat create --stream. - Structured output (
json_schemaresponse format,--json-schema). - Function-calling: a
RunWithTools/RunWithToolsLimitauto-executing loop, plus CLI tool declarations (--tool). - Deep-thinking controls (
--thinking,--effort) and advanced sampling flags (--stop,--top-p,--do-sample,--show-reasoning). - Automatic retry with exponential backoff, jitter, and
Retry-Aftersupport on 429/5xx/network errors. - Multimodal messages (
Message.Images) for vision models (GLM-4.6V/4.5V), wire-compatible with plain-text messages when no image is attached. - Image generation (
glm-image/CogView-4), video generation (CogVideoX-3/Vidu, always async), audio transcription/TTS, and OCR (layout parsing) services and CLI commands. - Files and Batch API services for bulk/async request processing.
- A full-screen terminal UI (
zai-client tui, nowgo-z-ai tui) with seven tabs: chat, models, usage, accounts, coding, media, tools. pkg/usageview, a presentation-only package shared by the CLI and TUI so usage/quota rendering (time windows, heat maps, relative timestamps) can't drift between the two.
Changed
context.Contextis now the first parameter on everypkg/clientservice method, threaded all the way to the HTTP call.- Removed a provider/app-config abstraction layer in favor of the simpler multi-account model.
Fixed
CreateStreamno longer gets cut off mid-generation byConfig.Timeout— the timeout now bounds dial/TLS/response-header wait, not the whole response body read.Tools,Account, andQuotaservices no longer built their own unconfiguredhttp.Clientper call (bypassing retry, timeout, and structured error parsing) — routed through the shared request facade.
2026-07-08
Added
- Initial release: chat completions, models, usage/quota/billing monitoring, and account operations, as both a CLI and a Go client library.
- A Go port of
@z_ai/coding-helper(pkg/coding) for configuring Claude Code, OpenCode, Crush, and Factory Droid to use a GLM Coding Plan credential, sharing the official helper's~/.chelper/config.yamlfile. - Multi-account credential management (
pkg/accounts) with automaticcoding_plan/pay_as_you_gotype detection. - Structured API error parsing with categories, user-facing messages, and retriable flags.