Skip to content

Commit 4633247

Browse files
committed
merge: integrate czy-all v1.8.0 into dev
Resolve v1.8.0 conflicts by keeping dev exports and adaptive-thinking safeguards while adopting upstream version updates. Clarify the best-of-both-worlds workflow for explicit direct merges from czy-all into dev.
2 parents c12560e + 7a57340 commit 4633247

6 files changed

Lines changed: 28 additions & 42 deletions

File tree

.claude/skills/best-of-both-worlds/SKILL.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: best-of-both-worlds
3-
description: "This skill should be used when the user asks to merge `caozhiyuan/all` into `czy-all`, push `czy-all`, create a PR from `czy-all` to `dev`, or resolve merge conflicts one by one by combining the best parts of both branches."
3+
description: "This skill should be used when the user asks to merge `caozhiyuan/all` into `czy-all`, push `czy-all`, create a PR from `czy-all` to `dev`, directly merge `czy-all` into `dev`, or resolve merge conflicts by combining both branches."
44
---
55

66
# Best of Both Worlds
@@ -31,6 +31,11 @@ description: "This skill should be used when the user asks to merge `caozhiyuan/
3131
1. 先把 `caozhiyuan/all` 同步到 `czy-all`(只在 `czy-all` 上操作)
3232
2. 再把 `czy-all -> dev`
3333

34+
`czy-all -> dev` 有两种合法执行方式,按用户意图选择:
35+
36+
- **PR 流(默认)**:推送 `origin/czy-all` 后创建或更新 `czy-all -> dev` PR,通过 GitHub PR 状态、checks、review 与最终授权完成合并。
37+
- **直接本地 merge 流(仅在用户明确说 “just merge from czy-all to dev” / “merge czy-all into dev” / 等价表达时)**:留在或切回 `dev`,执行 `git merge czy-all`,逐块解决冲突,验证后把 merge commit 落在 `dev`。这仍然是 `czy-all -> dev`,不是反向污染 `czy-all`
38+
3439
**禁止默认做法:**
3540

3641
- 未经用户明确要求,不得执行 `dev -> czy-all`(例如在 `czy-all` 上 merge `dev`)。
@@ -40,7 +45,7 @@ description: "This skill should be used when the user asks to merge `caozhiyuan/
4045
4146
1. **保持 tracking 不乱改。** 除非用户明确要求,不要擅自把 `czy-all` 的 upstream 从 `origin/czy-all` 改到别的远端。
4247
2. **把“拉内容”和“改 tracking”分开。** 需要同步 `caozhiyuan/all` 时,直接 `git pull caozhiyuan all` 或等价操作;不要顺手重写 upstream。
43-
3. **PR 方向固定** 这条工作流里,PR 默认是 `czy-all -> dev`
48+
3. **合并方向固定** 这条工作流里,默认 PR 方向是 `czy-all -> dev`;用户明确要求直接 merge 时,本地方向也是 `dev <- czy-all`
4449
4. **冲突逐个解,不批量糊。** 出现 PR conflict 后,不要直接全选 ours/theirs,不要一次性大面积接受某一边。
4550
5. **优先保留两边有效意图。** 目标不是“偏向哪边”,而是“best of both worlds”。
4651
6. **冲突决定权在用户。** agent 负责把每个冲突拆成可理解的选项、说明影响并执行用户决定;不要替用户拍板。
@@ -63,10 +68,10 @@ description: "This skill should be used when the user asks to merge `caozhiyuan/
6368
再做一次方向检查(必须明确回答):
6469

6570
- 本次是否在执行 `czy-all -> dev`
66-
- 当前操作是否只会临时切到 `czy-all` 做同步,然后回到 `dev`
71+
- 当前操作是否只会临时切到 `czy-all` 做同步,然后回到 `dev`;或在用户明确要求直接 merge 时留在 `dev` 执行 `git merge czy-all`
6772
- 当前操作是否会把 `dev` 反向写入 `czy-all`
6873

69-
若第三问答案是“会”,且用户未明确要求,则应立即停止并改回正确流程。
74+
若第三问答案是“会”,且用户未明确要求,则应立即停止并改回正确流程。用户明确要求“merge from `czy-all` to `dev`”时,执行 `dev <- czy-all`,不要误判为禁止项;禁止项只是不经授权把 `dev` 合回 `czy-all`
7075

7176
推荐命令:
7277

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@jeffreycao/copilot-api",
4-
"version": "1.7.3",
4+
"version": "1.8.0",
55
"description": "Turn GitHub Copilot into OpenAI/Anthropic API compatible server. Usable with Claude Code Or Codex Or Opencode!",
66
"keywords": [
77
"proxy",

src/lib/api-config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ export const getOpencodeVersion = () => {
146146
return OPENCODE_VERSION
147147
}
148148

149-
const OPENCODE_VERSION = "opencode/1.3.15"
149+
const OPENCODE_VERSION = "opencode/1.14.29"
150150
const OPENCODE_LLM_USER_AGENT =
151-
"opencode/1.3.15 ai-sdk/provider-utils/4.0.21 runtime/bun/1.3.11, opencode/1.3.15"
151+
"opencode/1.14.29 ai-sdk/provider-utils/4.0.23 runtime/bun/1.3.13, opencode/1.14.29"
152152

153-
export const COPILOT_VERSION = "0.44.2"
153+
export const COPILOT_VERSION = "0.46.0"
154154
const EDITOR_PLUGIN_VERSION = `copilot-chat/${COPILOT_VERSION}`
155155
const USER_AGENT = `GitHubCopilotChat/${COPILOT_VERSION}`
156156
const CLAUDE_AGENT_USER_AGENT =
157-
"vscode_claude_code/2.1.98 (external, sdk-ts, agent-sdk/0.2.98)"
157+
"vscode_claude_code/2.1.112 (external, sdk-ts, agent-sdk/0.2.112)"
158158

159159
const API_VERSION = "2025-10-01"
160160

src/services/copilot/create-messages.ts

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -153,54 +153,35 @@ const allowedAnthropicBetas = new Set([
153153
ADVANCED_TOOL_USE_BETA,
154154
])
155155

156-
const TOOL_SEARCH_SUPPORTED_MODELS = [
157-
"claude-sonnet-4.5",
158-
"claude-sonnet-4.6",
159-
"claude-opus-4.5",
160-
"claude-opus-4.6",
161-
] as const
162-
163-
const modelSupportsToolSearch = (modelId: string): boolean => {
164-
return TOOL_SEARCH_SUPPORTED_MODELS.some((prefix) =>
165-
modelId.toLowerCase().startsWith(prefix),
166-
)
167-
}
168-
169-
const resolveAnthropicBetaHeader = (
170-
options: CreateMessagesOptions,
171-
supportsAdaptive: boolean,
172-
payload: AnthropicMessagesPayload,
156+
const buildAnthropicBetaHeader = (
157+
anthropicBetaHeader: string | undefined,
158+
adaptiveThinkingEnabled: boolean,
159+
thinking: AnthropicMessagesPayload["thinking"],
173160
): string | undefined => {
174-
if (options.anthropicBeta) {
175-
const filteredBeta = options.anthropicBeta
161+
if (anthropicBetaHeader) {
162+
const filteredBeta = anthropicBetaHeader
176163
.split(",")
177164
.map((item) => item.trim())
178165
.filter((item) => item.length > 0)
179166
.filter((item) => allowedAnthropicBetas.has(item))
180167
const dedupedBetas = [...new Set(filteredBeta)]
181168
// Adaptive thinking conflicts with interleaved-thinking beta
182169
const finalFilteredBetas =
183-
supportsAdaptive ?
170+
adaptiveThinkingEnabled ?
184171
dedupedBetas.filter((item) => item !== INTERLEAVED_THINKING_BETA)
185172
: dedupedBetas
186173

187174
// in vscode copilot extension, advanced-tool-use is enabled by default
188175
// align header with vscode copilot extension
189-
190-
// will remove append ADVANCED_TOOL_USE_BETA in next github copilot extension version (>0.44.2)
191-
const copilotHeaderSet =
192-
modelSupportsToolSearch(payload.model) ? [ADVANCED_TOOL_USE_BETA] : []
193-
const headerSet = new Set([...copilotHeaderSet, ...finalFilteredBetas])
194-
const uniqueFilteredBetas = [...headerSet]
195-
176+
const uniqueFilteredBetas = [...new Set(finalFilteredBetas)]
196177
if (uniqueFilteredBetas.length > 0) {
197178
return uniqueFilteredBetas.join(",")
198179
}
199180

200181
return undefined
201182
}
202183

203-
if (!supportsAdaptive && payload.thinking?.budget_tokens) {
184+
if (!adaptiveThinkingEnabled && thinking?.budget_tokens) {
204185
return INTERLEAVED_THINKING_BETA
205186
}
206187

@@ -430,10 +411,10 @@ export const createMessages = async (
430411
const adaptiveThinkingEnabled =
431412
supportsAdaptive && !shouldDisableThinkingForToolChoice(payload)
432413

433-
const betaHeader = resolveAnthropicBetaHeader(
434-
options,
414+
const betaHeader = buildAnthropicBetaHeader(
415+
options.anthropicBeta,
435416
adaptiveThinkingEnabled,
436-
payload,
417+
payload.thinking,
437418
)
438419
if (betaHeader) {
439420
headers["anthropic-beta"] = betaHeader

src/services/get-vscode-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const FALLBACK = "1.116.0"
1+
const FALLBACK = "1.118.0"
22

33
export async function getVSCodeVersion() {
44
await Promise.resolve()

tests/api-config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe("prepareMessageProxyHeaders", () => {
101101
expect(headers["x-interaction-type"]).toBe("messages-proxy")
102102
expect(headers["openai-intent"]).toBe("messages-proxy")
103103
expect(headers["user-agent"]).toBe(
104-
"vscode_claude_code/2.1.98 (external, sdk-ts, agent-sdk/0.2.98)",
104+
"vscode_claude_code/2.1.112 (external, sdk-ts, agent-sdk/0.2.112)",
105105
)
106106
expect(headers["x-request-id"]).toBeDefined()
107107
expect(headers["x-agent-task-id"]).toBe(headers["x-request-id"])

0 commit comments

Comments
 (0)