coding-proxy 0.1.3a2__py3-none-any.whl → 0.1.4a2__py3-none-any.whl

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.

Potentially problematic release.


This version of coding-proxy might be problematic. Click here for more details.

@@ -61,6 +61,7 @@ def start(
61
61
  import uvicorn
62
62
 
63
63
  from ..server.app import create_app
64
+ from .banner import print_banner
64
65
 
65
66
  cfg_path = _resolve_config_path(config)
66
67
  cfg = load_config(cfg_path)
@@ -76,6 +77,10 @@ def start(
76
77
  from ..logging import build_log_config
77
78
 
78
79
  fastapi_app = create_app(cfg)
80
+
81
+ # 打印启动品牌横幅
82
+ print_banner(console, host=cfg.server.host, port=cfg.server.port)
83
+
79
84
  uvicorn.run(
80
85
  fastapi_app,
81
86
  host=cfg.server.host,
@@ -0,0 +1,61 @@
1
+ """CLI 启动品牌横幅.
2
+
3
+ 使用 Rich Panel 构建紧凑的品牌展示面板,
4
+ 在服务启动前向终端输出版本与监听地址信息。
5
+
6
+ 设计原则:
7
+ - 正交分解: 展示逻辑独立于业务逻辑
8
+ - 复用驱动: 使用项目已有的 Rich Console 模式
9
+ - 最小干预: 无新依赖,纯组合现有组件
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from typing import TYPE_CHECKING
15
+
16
+ from rich.panel import Panel
17
+ from rich.text import Text
18
+
19
+ if TYPE_CHECKING:
20
+ from rich.console import Console
21
+
22
+ from .. import __version__
23
+
24
+
25
+ def build_banner(host: str = "127.0.0.1", port: int = 8046) -> Panel:
26
+ """构建品牌横幅 Panel.
27
+
28
+ Args:
29
+ host: 监听地址.
30
+ port: 监听端口.
31
+
32
+ Returns:
33
+ 配置完成的 Rich Panel 实例.
34
+ """
35
+ brand_text = Text()
36
+ brand_text.append("⚡ ", style="bold")
37
+ brand_text.append("Coding Proxy", style="bold cyan")
38
+ brand_text.append("\n\n")
39
+
40
+ info_text = Text()
41
+ info_text.append("Version: ", style="dim")
42
+ info_text.append(__version__, style="green")
43
+ info_text.append(" │ ", style="dim")
44
+ info_text.append("Listening: ", style="dim")
45
+ info_text.append(f"http://{host}:{port}", style="blue")
46
+ brand_text.append(info_text)
47
+
48
+ return Panel(brand_text, border_style="cyan", padding=(1, 2), expand=False)
49
+
50
+
51
+ def print_banner(console: Console, host: str = "127.0.0.1", port: int = 8046) -> None:
52
+ """通过指定 Console 打印品牌横幅.
53
+
54
+ Args:
55
+ console: Rich Console 实例(复用 CLI 层已有实例).
56
+ host: 监听地址.
57
+ port: 监听端口.
58
+ """
59
+ console.print()
60
+ console.print(build_banner(host=host, port=port))
61
+ console.print()
@@ -43,9 +43,13 @@ def _strip_thinking_blocks(body: dict[str, Any]) -> int:
43
43
  ]
44
44
  removed = original_len - len(new_content)
45
45
  if removed and not new_content:
46
- logger.warning(
47
- "anthropic: assistant message content became empty after "
48
- "stripping %d thinking block(s); this may cause API errors",
46
+ # 剥离所有 thinking blocks 后 content 为空 ——
47
+ # Anthropic API 要求非末尾 assistant message 的 content 必须非空。
48
+ # 插入最小占位 text block 以保持消息结构合法性。
49
+ new_content = [{"type": "text", "text": "[thinking]"}]
50
+ logger.info(
51
+ "anthropic: inserted placeholder text block after stripping "
52
+ "%d thinking block(s) to avoid empty assistant content",
49
53
  removed,
50
54
  )
51
55
  message["content"] = new_content
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coding-proxy
3
- Version: 0.1.3a2
3
+ Version: 0.1.4a2
4
4
  Summary: A High-Availability, Transparent, and Smart Multi-Vendor Proxy for Claude Code. Support Claude Plans, GitHub Copilot, Google Antigravity, ZAI/GLM.
5
5
  Project-URL: Source Code, https://github.com/ThreeFish-AI/coding-proxy
6
6
  Project-URL: User Guide, https://github.com/ThreeFish-AI/coding-proxy/blob/master/docs/user-guide.md
@@ -9,8 +9,9 @@ coding/proxy/auth/providers/__init__.py,sha256=hnGL_aSHcMxiZHK6HKPWD0_tWSPcwuxwQ
9
9
  coding/proxy/auth/providers/base.py,sha256=TOtCi2b81-UBdEoWMv7HbYSmRxAjGSvnF1yBxazqai0,1092
10
10
  coding/proxy/auth/providers/github.py,sha256=xH6yygAzt8vI-MXV8EHl2tg4RcOmLaLBns93PBCyVG8,4835
11
11
  coding/proxy/auth/providers/google.py,sha256=MhbM5PXmgwQBgWCMDkhK_7GYyvS-IdPV4ATxKYH6WXM,8402
12
- coding/proxy/cli/__init__.py,sha256=iny6-TPyhljsSSgpFeyiaTYq7EegsbadwlZ19asSYpI,5211
12
+ coding/proxy/cli/__init__.py,sha256=Z_M8stwACJ2Bvge2y9XrupXPHJDg39za2PYcm0NBtYI,5351
13
13
  coding/proxy/cli/auth_commands.py,sha256=tN5jWJo8sJP8jgoN4WH5iTl9rhi4xWPLMptgeTHIFpE,9212
14
+ coding/proxy/cli/banner.py,sha256=gat7QGpfocL0wiAw3-MSUsCviyc59Sf-XswOp7Pg6LI,1694
14
15
  coding/proxy/compat/__init__.py,sha256=-msRszArsk2YJJtOeaidYDd1tAQEzeE91LvCi1CyMis,721
15
16
  coding/proxy/compat/canonical.py,sha256=-zcuEwZ402xeH3C545RmuYRkT2HDuvFloyFydDv8Zts,7507
16
17
  coding/proxy/compat/session_store.py,sha256=B9IFjjQJnHMg1244m__jG9gnqGWi26-JyEtwopEri6Q,5244
@@ -61,7 +62,7 @@ coding/proxy/server/routes.py,sha256=QeEsYczjvPfVhOrED2qe1V6CpwVBZbQHs8dP0OGdGXQ
61
62
  coding/proxy/streaming/__init__.py,sha256=0al5TC-zJt8Bz0CibTmd8WPza-Cs-qcuZWvT2fKPqHI,23
62
63
  coding/proxy/streaming/anthropic_compat.py,sha256=cycYiJ-glN88OmfLTR7FroHRethONlEcK0PT78KqGbA,21202
63
64
  coding/proxy/vendors/__init__.py,sha256=fehSpQ2-kUlZY6N8cNMGVJYMXspQmi3V4e0FgC4Ay4k,1011
64
- coding/proxy/vendors/anthropic.py,sha256=yz7pqPmsIullv-_mV6N3EK4OqjJ3geICDfp7vPxbSN0,3704
65
+ coding/proxy/vendors/anthropic.py,sha256=krdbP38Rs-BLPsyQD7AmYK2Uf0-s_soLoPhoaAqC0Do,4004
65
66
  coding/proxy/vendors/antigravity.py,sha256=zVl2fguxyIy3OjkosZYr2n5tR8dEEIjxazBEXY7v6BQ,13300
66
67
  coding/proxy/vendors/base.py,sha256=3f9jAWWuYm0d_TS59gIRSCfxijw6iwjmq-q1ugJicfg,14763
67
68
  coding/proxy/vendors/copilot.py,sha256=qAFTO2xMqnawaFlvZS2a9-7f_UEkfODIFfDlgOBiQl4,29590
@@ -71,8 +72,8 @@ coding/proxy/vendors/copilot_urls.py,sha256=YxaR6zmPdrySzsotJx6PjNIu2JIGG6N1D8kZ
71
72
  coding/proxy/vendors/mixins.py,sha256=eZd_vlsPCKUNOEWSxWTDDb5i24GUIE3_JZDsj5LMr08,2583
72
73
  coding/proxy/vendors/token_manager.py,sha256=s10t4Com0jNnKGkPyJ_HpG5SjHrCEJvfArEOAaPKA_k,4189
73
74
  coding/proxy/vendors/zhipu.py,sha256=R4SOI9hKYnPk7sifSswsJpaEyWH6x3Ijo5ZoZSzFw7s,9623
74
- coding_proxy-0.1.3a2.dist-info/METADATA,sha256=-JVT4eVT3VfLEfAs6yos29Mg6asRm6pf4PHCw5Q3ixs,10782
75
- coding_proxy-0.1.3a2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
76
- coding_proxy-0.1.3a2.dist-info/entry_points.txt,sha256=moIVzt5ho0Wk9B47LOo2SEAbhzuDDHWi-EfM30U0XBg,54
77
- coding_proxy-0.1.3a2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
78
- coding_proxy-0.1.3a2.dist-info/RECORD,,
75
+ coding_proxy-0.1.4a2.dist-info/METADATA,sha256=pChlWmi33ABa0MMx3UIBwKeV47ZpTjshVvLzVEPUkys,10782
76
+ coding_proxy-0.1.4a2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
77
+ coding_proxy-0.1.4a2.dist-info/entry_points.txt,sha256=moIVzt5ho0Wk9B47LOo2SEAbhzuDDHWi-EfM30U0XBg,54
78
+ coding_proxy-0.1.4a2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
79
+ coding_proxy-0.1.4a2.dist-info/RECORD,,