Skip to content
Closed
2 changes: 1 addition & 1 deletion apps/server/src/provider/Drivers/ClaudeSkills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function parseSkillFrontmatter(contents: string): SkillFrontmatter {
* `CLAUDE_CONFIG_DIR` by `makeClaudeEnvironment`), then a `CLAUDE_CONFIG_DIR`
* already present in the process environment, then `~/.claude`.
*/
const resolveClaudeConfigDirPath = Effect.fn("resolveClaudeConfigDirPath")(function* (
export const resolveClaudeConfigDirPath = Effect.fn("resolveClaudeConfigDirPath")(function* (
config: Pick<ClaudeSettings, "homePath">,
environment: NodeJS.ProcessEnv,
cwd?: string,
Expand Down
19 changes: 18 additions & 1 deletion apps/server/src/provider/Layers/ClaudeAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ interface ClaudeResumeState {
readonly resume?: string;
readonly resumeSessionAt?: string;
readonly turnCount?: number;
// Per-thread, decided once at thread creation (see
// ClaudeSessionHistory.bindSessionLaunchOptions) — not a resume concept,
// just piggybacking on the same opaque per-thread `resumeCursor` bag
// rather than growing ProviderSessionStartInput's cross-provider schema
// for a single-driver launch flag.
readonly remoteControl?: boolean;
}

interface ClaudeTurnState {
Expand Down Expand Up @@ -565,6 +571,7 @@ function readClaudeResumeState(resumeCursor: unknown): ClaudeResumeState | undef
sessionId?: unknown;
resumeSessionAt?: unknown;
turnCount?: unknown;
remoteControl?: unknown;
};

const threadIdCandidate = typeof cursor.threadId === "string" ? cursor.threadId : undefined;
Expand All @@ -582,6 +589,7 @@ function readClaudeResumeState(resumeCursor: unknown): ClaudeResumeState | undef
const resumeSessionAt =
typeof cursor.resumeSessionAt === "string" ? cursor.resumeSessionAt : undefined;
const turnCountValue = typeof cursor.turnCount === "number" ? cursor.turnCount : undefined;
const remoteControl = cursor.remoteControl === true ? true : undefined;

return {
...(threadId ? { threadId } : {}),
Expand All @@ -590,6 +598,7 @@ function readClaudeResumeState(resumeCursor: unknown): ClaudeResumeState | undef
...(turnCountValue !== undefined && Number.isInteger(turnCountValue) && turnCountValue >= 0
? { turnCount: turnCountValue }
: {}),
...(remoteControl ? { remoteControl } : {}),
};
}

Expand Down Expand Up @@ -3484,7 +3493,15 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
runPromise(canUseToolEffect(toolName, toolInput, callbackOptions));

const claudeBinaryPath = claudeSdkExecutablePath;
const extraArgs = parseCliArgs(claudeSettings.launchArgs).flags;
const extraArgs = {
...parseCliArgs(claudeSettings.launchArgs).flags,
// Either the per-instance persistent setting or a per-thread
// choice made when the thread was created (see
// ClaudeSessionHistory.bindSessionLaunchOptions) enables it.
...(claudeSettings.remoteControl || resumeState?.remoteControl
? { "remote-control": null }
: {}),
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
};
const modelSelection =
input.modelSelection?.instanceId === boundInstanceId ? input.modelSelection : undefined;
const caps = getClaudeModelCapabilities(modelSelection?.model);
Expand Down
Loading
Loading