Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/server/src/provider/Layers/ClaudeAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,24 @@ describe("ClaudeAdapterLive", () => {
);
});

it.effect("includes settingSources for user and project level settings", () => {
const harness = makeHarness();
return Effect.gen(function* () {
const adapter = yield* ClaudeAdapter;
yield* adapter.startSession({
threadId: THREAD_ID,
provider: "claudeAgent",
runtimeMode: "full-access",
});

const createInput = harness.getLastCreateQueryInput();
assert.deepEqual(createInput?.options.settingSources, ["user", "project"]);
}).pipe(
Effect.provideService(Random.Random, makeDeterministicRandomService()),
Effect.provide(harness.layer),
);
});

it.effect("treats ultrathink as a prompt keyword instead of a session effort", () => {
const harness = makeHarness();
return Effect.gen(function* () {
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/provider/Layers/ClaudeAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2576,6 +2576,7 @@ function makeClaudeAdapter(options?: ClaudeAdapterLiveOptions) {
includePartialMessages: true,
canUseTool,
env: process.env,
settingSources: ["user", "project"],
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

settingSources changes the Claude SDK session behavior, but there’s no test assertion that createQuery receives the expected sources. Please add/extend a unit test (e.g. in ClaudeAdapter.test.ts) to verify createInput.options.settingSources is set, so regressions don’t silently disable Skills/Commands/CLAUDE.md again.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a test for this in b76aed7

Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coding settingSources: ["user", "project"] means the server process will load host-level ~/.claude/* settings and project .claude/* files for every session. In web mode (where the server can bind to non-loopback), this can unintentionally apply/possibly expose host-specific CLAUDE.md memory, Skills, or slash commands to any authenticated client. Consider making settingSources configurable (e.g. via providerOptions.claudeAgent) and/or defaulting to a safer value (like only "project", or only enabling "user" in desktop mode).

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t3code is desktop-first and web mode still requires authentication, so the exposure risk here is pretty minimal. this change unblocks a commonly requested feature (skills/commands/memory). if web mode isolation becomes an actual concern down the line, we can scope settingSources per mode in a follow-up.

...(input.cwd ? { additionalDirectories: [input.cwd] } : {}),
};

Expand Down