fix: 修复 Windows 环境下设置页 API Config 读取和 git-bash 路径检测问题 (closes #22, closes #23) - #24
Closed
gy212 wants to merge 1 commit into
Closed
fix: 修复 Windows 环境下设置页 API Config 读取和 git-bash 路径检测问题 (closes #22, closes #23)#24gy212 wants to merge 1 commit into
gy212 wants to merge 1 commit into
Conversation
1. 设置页 API Config 无法读取环境变量中的中转 URL 和 API Key (#22) - GET 接口增加环境变量回退读取 (ANTHROPIC_AUTH_TOKEN / ANTHROPIC_API_KEY / ANTHROPIC_BASE_URL) - 前端显示 "from env" 标签,提示用户当前值来源 - 保存后自动刷新显示状态 2. Windows 上 Git 安装在非标准路径时 Claude CLI 退出码 1 (#23) - 新增 findGitBash() 自动检测 git-bash 路径 - 检测优先级:环境变量 > 常见路径 > where git 推导 - 在 SDK 环境变量中自动设置 CLAUDE_CODE_GIT_BASH_PATH
gy212
commented
Feb 8, 2026
ContributorAuthor
op7418
requested changes
Feb 8, 2026
op7418
left a comment
Owner
There was a problem hiding this comment.
Review: 建议拆分 PR
此 PR 包含两个独立修复,其中一个已与 main 冲突,建议拆分处理。
Bug 1: Settings 环境变量回退 — 建议关闭
Main 分支已移除 ApiConfigSection 组件(已被 ProviderManager 替代)。PR 修改的组件在 main 上已不存在,无法合并。
如果仍需环境变量回退功能,应在新的 ProviderManager 体系中重新实现。
Bug 2: Git-bash 路径检测 — 建议单独提 PR
代码质量良好:
findGitBash()三级回退策略(环境变量 → 常见路径 → where git 推导)覆盖主要场景- 与 main 无冲突,有独立价值
建议:请将 Bug 2(platform.ts + claude-client.ts 的改动)单独提交为新 PR,即可合并。
gy212
commented
Feb 8, 2026
ContributorAuthor
按作者建议拆分:Bug 1 因 main 分支已移除 ApiConfigSection 组件而无法合并,Bug 2 将单独提交新 PR。 |
youcho2 pushed a commit
to youcho2/CodePilot
that referenced
this pull request
Aug 11, 2026
youcho2 pushed a commit
to youcho2/CodePilot
that referenced
this pull request
Aug 11, 2026
…ence 到 Smoke Ledger
## 收尾内容
### 1. Smoke Ledger 补真实 evidence (3 Runtime 反例 + 触发)
- ClaudeCode baseline (0 tool_use, DB row f2b2503d): entries={rules:93}
- ClaudeCode trigger Bash×1 (DB row 033fd785): entries={rules, tools:Bash×1=48}
- Native trigger Bash×3 + Read×2 (DB row 0d80f997): entries={rules, tools:'Bash × 3, Read × 2'=813}, producedBy='codepilot_runtime'
- Codex codepilot_proxy trigger Bash×1 (DB row 50f3f89a): entries={rules, tools:Bash×1=2062}, producedBy='codex_runtime', providerBackend='codepilot_proxy', context_window=258400
- V6 bug 修复确认: 同 Widget 输入 (golden fixture) 跑 collectAutoInvokeSnapshot 单元测试断言 entries.skills(humanizer-zh) + entries.mcp(2 servers) + entries.tools(Bash×2)
### 2. 标记 Phase 7 + Phase 5 全部 ✅
- 实施状态表 Phase 5: ✅ 由 Phase 7.7 Smoke Ledger 真实 evidence 段全面取代
- Phase 7: ✅ 9 子阶段全部完成 commit dd99d8b + 后续 4 bugfix
- 决策日志加 closeout 条目 — 4 commit 链 + 跨 Agent 扩展规则沉淀 + 保留 tech-debt op7418#22/op7418#24
### 3. 归档 plan + smoke evidence
- docs/exec-plans/active/context-accounting-runtime-contract.md → completed/
- docs/exec-plans/active/_smoke-evidence/ → completed/_smoke-evidence-phase-7/
### 4. 同步 README.md + 反向链接
- README.md Active 表去掉本 plan 行
- README.md Completed 表加本 plan 行(2026-05-20)
- phase-6-context-visualization.md 反向引用从 active/ 改 completed/
- docs/research/codex-sdk-tool-call-surface.md 父计划链接更新
- src/lib/harness/auto-invoke-accounting.ts 跨 Agent 扩展指引链接更新
## 不在本轮 scope
- tech-debt op7418#22 (selectedSkills 同名歧义) — 保留 deferred
- tech-debt op7418#24 (footer cost 双计 P2) — 保留 deferred
- MCP server tool schemas 系统提示注入估算 — Phase 8 范围
- memory / files_attachments 接通 — Phase 6.x 范围
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>youcho2 pushed a commit
to youcho2/CodePilot
that referenced
this pull request
Aug 11, 2026
…ce + 实施状态 + 决策日志 closeout 条目 前一个 commit 675fcf8 完成了 rename + README 同步,但 plan 文件内容更新(Smoke Ledger 真实 evidence 段 + 实施状态表 Phase 5/7 → ✅ + 决策日志 closeout 条目)实际未 staged。本 commit 补上。 内容: - Smoke Ledger 段从 v6 增补的待办表替换为 Phase 7 closeout 真实 evidence 段 - 3 Runtime DB row dump:ClaudeCode baseline (0 tool_use) / ClaudeCode Bash×1 / Native Bash×3+Read×2 / Codex codepilot_proxy Bash×1 - 实施状态表 Phase 5 → ✅ 由 7.7 取代;Phase 7 → ✅ 9 子阶段完成 - 决策日志加 Phase 7 closeout 条目 (4 bugfix commit 链 + 跨 Agent 规则 + tech-debt op7418#22/op7418#24 保留) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

概述
修复 Windows 环境下的两个 Bug,对应 Issue #22 和 #23。
Bug 1: 设置页 API Config 无法读取环境变量 (#22)
问题
设置页 "Save API Config" 无法捕获本地 CLI 已配置的中转 URL 和 API Key。用户通过环境变量(如
ANTHROPIC_AUTH_TOKEN、ANTHROPIC_BASE_URL)配置的值不会显示在设置页中。修复
src/app/api/settings/app/route.ts:GET 接口增加环境变量回退逻辑,当数据库中无值时依次检查ANTHROPIC_AUTH_TOKEN、ANTHROPIC_API_KEY、ANTHROPIC_BASE_URL环境变量,并返回值来源(db或env)src/app/settings/page.tsx:前端显示from env标签提示用户当前值来自环境变量;保存后自动刷新状态Bug 2: Windows 上 Git 安装在非标准路径时 Claude CLI 退出码 1 (#23)
问题
Git 安装在非默认路径(如
D:\APP\Git)时,Claude CLI 无法找到bash.exe,进程以退出码 1 退出,报错:修复
src/lib/platform.ts:新增findGitBash()函数,按优先级自动检测 git-bash 路径:CLAUDE_CODE_GIT_BASH_PATH(用户手动设置)C:\Program Files\Git\bin\bash.exe等)where git命令推导 Git 安装目录src/lib/claude-client.ts:在构建 SDK 子进程环境变量时,仅在 Windows 平台且未设置CLAUDE_CODE_GIT_BASH_PATH时调用自动检测修改文件
src/app/api/settings/app/route.tssrc/app/settings/page.tsxsrc/lib/platform.tsfindGitBash()自动检测函数src/lib/claude-client.ts