Skip to content

Commit f13d332

Browse files
committed
chore(release): 升级版本号至 v0.1.4a7;
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
1 parent abc13ea commit f13d332

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "coding-proxy"
3-
version = "0.1.4a6"
3+
version = "0.1.4a7"
44
description = "A High-Availability, Transparent, and Smart Multi-Vendor Proxy for Claude Code. Support Claude Plans, GitHub Copilot, Google Antigravity, ZAI/GLM."
55
readme = "README.md"
66
requires-python = ">=3.12"

src/coding/proxy/server/request_normalizer.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def next_tool_id() -> str:
5959
return f"toolu_normalized_{normalized_counter}"
6060

6161
# 收集本轮被剥离的 misplaced tool_result 信息(用于汇总日志)
62-
stripped_misplaced: list[tuple[str, int, int, str]] = [] # (role, msg_idx, blk_idx, tool_use_id)
62+
stripped_misplaced: list[
63+
tuple[str, int, int, str]
64+
] = [] # (role, msg_idx, blk_idx, tool_use_id)
6365

6466
def normalize_content_block(
6567
block: Any,
@@ -144,7 +146,12 @@ def normalize_content_block(
144146
# Anthropic API 严格要求 tool_result 只能出现在 user 消息中,因此必须剥离。
145147
adaptations.append("misplaced_tool_result_stripped")
146148
stripped_misplaced.append(
147-
(message_role, message_index, block_index, block.get("tool_use_id", "N/A"))
149+
(
150+
message_role,
151+
message_index,
152+
block_index,
153+
block.get("tool_use_id", "N/A"),
154+
)
148155
)
149156
return None
150157

@@ -216,7 +223,9 @@ def _emit_misplaced_tool_result_summary(
216223
# 更新已报告集合(防止无限增长:保留最近一半条目)
217224
_LOGGED_MISPLACED_TOOL_IDS.update(unique_tool_ids)
218225
if len(_LOGGED_MISPLACED_TOOL_IDS) > _LOGGED_MISPLACED_TOOL_IDS_MAX:
219-
to_keep = sorted(_LOGGED_MISPLACED_TOOL_IDS)[_LOGGED_MISPLACED_TOOL_IDS_MAX // 2:]
226+
to_keep = sorted(_LOGGED_MISPLACED_TOOL_IDS)[
227+
_LOGGED_MISPLACED_TOOL_IDS_MAX // 2 :
228+
]
220229
_LOGGED_MISPLACED_TOOL_IDS.clear()
221230
_LOGGED_MISPLACED_TOOL_IDS.update(to_keep)
222231

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)