@oneciel-ai/ciel-runtime 0.2.32 → 0.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  This file records stable Ciel Runtime releases. Changes are grouped by user-visible
4
4
  capability, followed by the complete commit ledger merged into each release.
5
5
 
6
+ ## 0.2.33 — 2026-08-24
7
+
8
+ - Send `User-Agent: ZCode/<configured app version>` for every Z.AI provider
9
+ profile, not only Start Plan.
10
+ - Match ZCode's Anthropic Start Plan authentication wire contract by sending
11
+ the same credential in both `Authorization: Bearer` and `x-api-key`.
12
+ - Allow an explicitly configured remote CAPTCHA receiver port to be reused by
13
+ consecutive model requests after the prior receiver shuts down.
14
+
6
15
  ## 0.2.32 — 2026-08-24
7
16
 
8
17
  - Keep Z.AI Start Plan wire identity aligned with the installed ZCode app:
@@ -42,6 +42,7 @@ class ZaiProviderAdapter(HttpBearerProviderAdapter):
42
42
  haiku_model="glm-4.7",
43
43
  subagent_model="glm-5.3[1m]",
44
44
  managed_mcp=True,
45
+ zcode_app_version="3.8.1",
45
46
  )
46
47
  )
47
48
  send_placeholder_key: bool = True
@@ -70,6 +71,19 @@ class ZaiProviderAdapter(HttpBearerProviderAdapter):
70
71
  def normalize_model_id(self, model_id: str) -> str:
71
72
  return str(model_id or "").strip()
72
73
 
74
+ def build_headers(
75
+ self, config: ProviderConfig, api_key: str | None
76
+ ) -> Mapping[str, str]:
77
+ headers = dict(super().build_headers(config, api_key))
78
+ version = str(config.options.get("zcode_app_version") or "3.8.1").strip()
79
+ headers["User-Agent"] = f"ZCode/{version}"
80
+ return headers
81
+
82
+ def build_model_headers(
83
+ self, config: ProviderConfig, api_key: str | None
84
+ ) -> Mapping[str, str]:
85
+ return self.build_headers(config, api_key)
86
+
73
87
  def upstream_api_model_id(self, model_id: str) -> str:
74
88
  return super().normalize_model_id(model_id)
75
89
 
@@ -289,7 +303,7 @@ class ZaiStartPlanProviderAdapter(ZaiCodingPlanProviderAdapter):
289
303
 
290
304
  name: str = "zai-start-plan"
291
305
  base_url: str = PROVIDER_DEFAULT_BASE_URLS["zai-start-plan"]
292
- include_x_api_key: bool = False
306
+ include_x_api_key: bool = True
293
307
  capabilities_value: ProviderCapabilities = field(
294
308
  default_factory=lambda: ProviderCapabilities(
295
309
  upstream_protocol="anthropic_messages",
@@ -87,7 +87,7 @@ OPENCODE_ENDPOINT_ALIASES = {
87
87
  }
88
88
 
89
89
  APP_NAME = "Ciel Runtime"
90
- VERSION = "0.2.32"
90
+ VERSION = "0.2.33"
91
91
  CREDITS = "Credits: One Ciel LLC"
92
92
  PRELAUNCH_CANCEL = 10
93
93
  PRELAUNCH_LAUNCH_CODEX = 11
@@ -69,7 +69,7 @@ class ZaiStartPlanCaptchaConfig:
69
69
 
70
70
  class _LoopbackCaptchaServer(ThreadingHTTPServer):
71
71
  daemon_threads = True
72
- allow_reuse_address = False
72
+ allow_reuse_address = True
73
73
 
74
74
 
75
75
  @dataclass(slots=True)
@@ -414,6 +414,10 @@ Z.AI Start Plan은 모델 요청 전에 공식 Aliyun CAPTCHA의 일회성 결
414
414
  있습니다. 브라우저가 없는 원격 호스트에서는 `provider-options`로 운영자
415
415
  브라우저가 접근할 callback origin을 설정할 수 있습니다.
416
416
 
417
+ 모든 Z.AI 프로필은 `zcode_app_version`에 맞춘
418
+ `User-Agent: ZCode/<version>`을 전송합니다. Start Plan의 Anthropic 요청은 ZCode와
419
+ 동일하게 같은 OAuth JWT를 `Authorization: Bearer`와 `x-api-key`에 함께 넣습니다.
420
+
417
421
  ```bash
418
422
  ciel-runtimectl provider-options zai-start-plan \
419
423
  captcha_bind_host=100.95.132.58 \
@@ -15,6 +15,10 @@ knowledge:
15
15
  app_version: 3.8.1
16
16
  header_builder_observation: >-
17
17
  The bundled ZCode runtime constructs User-Agent as ZCode/<appVersion>.
18
+ anthropic_auth_observation: >-
19
+ The bundled runtime's Anthropic factory adds Authorization: Bearer with
20
+ the provider credential and the Anthropic SDK also sends x-api-key with
21
+ that same credential.
18
22
  mia_installed_ciel_runtime:
19
23
  version: 0.2.31-nightly.20260824-143754.e0bf793
20
24
  provider: zai-start-plan
@@ -24,7 +28,7 @@ knowledge:
24
28
  authorization_present: true
25
29
  authorization_scheme: Bearer
26
30
  authorization_token_matches_configured_credential: true
27
- x_api_key_present: false
31
+ x_api_key_present_before_0_2_33: false
28
32
  secret_handling: >-
29
33
  The credential value was not printed; verification used equality and
30
34
  scheme checks only.
@@ -42,9 +46,27 @@ knowledge:
42
46
  screenshot_observation: >-
43
47
  The official Aliyun SDK displayed a human slider puzzle; changing UA or
44
48
  running headed Chrome did not turn it into a traceless pass.
49
+ post_captcha_upstream:
50
+ endpoint: https://zcode.z.ai/api/v1/zcode-plan/anthropic/v1/messages
51
+ invalid_captcha_result: "HTTP 400, provider code 3007"
52
+ fresh_captcha_result: "HTTP 405, provider code 3012"
53
+ exact_zcode_identity_headers_tested: true
54
+ bearer_and_x_api_key_tested: true
55
+ model_tested: GLM-5.2
56
+ conclusion: >-
57
+ The remaining 3012 response occurs after CAPTCHA verification and is
58
+ not evidence of a missing User-Agent or missing credential header. Its
59
+ upstream cause is not yet established.
60
+ fixed_port_reuse:
61
+ mia_observation: >-
62
+ A consecutive request on configured port 42121 failed to bind with
63
+ Linux errno 98 while the previous connection was in TIME_WAIT.
45
64
 
46
65
  implementation:
47
- auth_and_ua_behavior_change: none
66
+ auth_and_ua_behavior_change: >-
67
+ All Z.AI profiles now send User-Agent ZCode/<configured app version>.
68
+ Start Plan now sends its OAuth JWT in both Authorization: Bearer and
69
+ x-api-key, matching the installed ZCode Anthropic adapter.
48
70
  remote_captcha_callback:
49
71
  default_bind_host: 127.0.0.1
50
72
  configurable_fields:
@@ -59,7 +81,10 @@ knowledge:
59
81
  file: tests/test_zai_provider.py
60
82
  assertion: >-
61
83
  A real loopback HTTP request must retain User-Agent ZCode/3.8.1 and the
62
- OAuth Bearer token and must not add X-Api-Key.
84
+ OAuth credential in both Authorization and X-Api-Key.
85
+ fixed_port_reuse_change: >-
86
+ The CAPTCHA HTTP server enables address reuse so an explicitly configured
87
+ port can serve consecutive request-scoped receivers.
63
88
 
64
89
  verification:
65
90
  completed:
@@ -70,6 +95,10 @@ knowledge:
70
95
  - remote callback GET 200 and state-bound result POST 204 from operator host
71
96
  - operator Chrome traceless verification completed with a 280-byte result
72
97
  - verification completion screenshot captured
98
+ - exact x-api-key-only live request returned HTTP 401
99
+ - exact Bearer plus x-api-key live request passed CAPTCHA and returned
100
+ upstream HTTP 405 / code 3012
101
+ - focused Z.AI regression tests: 55 passed
73
102
  pending:
74
- - real Z.AI model response after CAPTCHA
103
+ - establish the upstream reason for provider code 3012
75
104
  - main, nightly, npm, and local deployment verification
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneciel-ai/ciel-runtime",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "description": "Universal AI coding-agent runtime and model-routing layer for Claude, Codex, AGY, ZCode, and compatible runtimes.",
5
5
  "license": "MIT",
6
6
  "author": "One Ciel LLC",