chatccc 0.2.77 → 0.2.78
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.
package/package.json
CHANGED
|
@@ -581,7 +581,7 @@ describe("createClaudeAdapter — sessionOpts 形状", () => {
|
|
|
581
581
|
permissionMode: "bypassPermissions",
|
|
582
582
|
allowDangerouslySkipPermissions: true,
|
|
583
583
|
autoCompactEnabled: true,
|
|
584
|
-
settingSources: ["project", "local"],
|
|
584
|
+
settingSources: ["user", "project", "local"],
|
|
585
585
|
});
|
|
586
586
|
});
|
|
587
587
|
|
|
@@ -856,7 +856,7 @@ describe("createClaudeAdapter — env 注入", () => {
|
|
|
856
856
|
expect(opts.env.CLAUDE_CODE_EFFORT_LEVEL).toBeUndefined();
|
|
857
857
|
});
|
|
858
858
|
|
|
859
|
-
it("第三方 API 配置时仍然加载 CLAUDE.md(settingSources
|
|
859
|
+
it("第三方 API 配置时仍然加载 CLAUDE.md(settingSources 包含 user+project+local)", async () => {
|
|
860
860
|
setupMockCreateSession();
|
|
861
861
|
const adapter = createClaudeAdapter({
|
|
862
862
|
model: "",
|
|
@@ -869,7 +869,7 @@ describe("createClaudeAdapter — env 注入", () => {
|
|
|
869
869
|
await adapter.createSession("/cwd");
|
|
870
870
|
|
|
871
871
|
const opts = sdk.unstable_v2_createSession.mock.calls[0][0];
|
|
872
|
-
expect(opts.settingSources).toEqual(["project", "local"]);
|
|
872
|
+
expect(opts.settingSources).toEqual(["user", "project", "local"]);
|
|
873
873
|
});
|
|
874
874
|
|
|
875
875
|
it("不修改主进程 process.env(永不污染)", async () => {
|
|
@@ -117,10 +117,12 @@ function buildSdkEnv(
|
|
|
117
117
|
function resolveSettingSources(
|
|
118
118
|
_apiKey: string | undefined,
|
|
119
119
|
_baseUrl: string | undefined,
|
|
120
|
-
): Array<"project" | "local"> {
|
|
120
|
+
): Array<"user" | "project" | "local"> {
|
|
121
121
|
// CLAUDE.md / CLAUDE.local.md 是 Agent 指令文件,与 API 来源无关,
|
|
122
122
|
// 无论使用官方 Anthropic 还是第三方网关都应加载。
|
|
123
|
-
|
|
123
|
+
// 包含 "user" 以使 ~/.claude/settings.json 中的配置(如 mcpServers)生效;
|
|
124
|
+
// buildSdkEnv() 会删除可能冲突的 env 变量,确保网关配置不被覆盖。
|
|
125
|
+
return ["user", "project", "local"];
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
// ---------------------------------------------------------------------------
|