fix(claude): preserve hooks and includeCoAuthoredBy#1916
fix(claude): preserve hooks and includeCoAuthoredBy#1916zerone0x wants to merge 1 commit intofarion1231:mainfrom
Conversation
Fixes farion1231#1907 Co-Authored-By: Claude <noreply@anthropic.com>
|
Hi, I owe you an apology for the long silence. As the sole maintainer of this project, I've been overwhelmed and fell behind on reviews — but that's on me, not on you. Your contribution matters and I will review this PR. If it needs a rebase, just let me know or I can handle it. Thank you for your time and patience. |
|
Hi @zerone0x, thanks for taking the time to look into #1907 and for the clean, well-scoped PR. Unfortunately I don't think this direction is the right fix — let me explain the reasoning so we're on the same page. Why a hardcoded field whitelist isn't the fix we want cc-switch treats each provider as a complete, self-contained snapshot of Layering a hardcoded
The intended fix for #1907 The recommended path is already documented in the README FAQ ("My plugin configuration disappeared after switching providers"): extract If you'd still like to contribute in this area A couple of directions that would be a good fit, if you're interested:
Either of those I'd be happy to review. Thanks again for digging in — the investigation and test you added were solid, it's just that the approach conflicts with the design direction we want to stick with. |
Summary / 概述
When syncing Claude providers, preserve existing
hooksandincludeCoAuthoredByvalues from the current~/.claude/settings.jsonif the provider config does not define them. This prevents those fields from being wiped during node/provider switches.Related Issue / 关联 Issue
Fixes #1907
Screenshots / 截图
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查pnpm format:checkpasses / 通过代码格式检查cargo clippypasses (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)