Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,8 @@ jobs:
with:
node-version-file: package.json

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Exercise release-only workflow steps
run: node scripts/release-smoke.ts
3 changes: 3 additions & 0 deletions apps/server/src/provider/Layers/ClaudeAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
type SDKUserMessage,
ModelUsage,
} from "@anthropic-ai/claude-agent-sdk";
import { parseCliArgs } from "@marcode/shared/cliArgs";
import {
ApprovalRequestId,
type CanonicalItemType,
Expand Down Expand Up @@ -2992,6 +2993,7 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
),
);
const claudeBinaryPath = claudeSettings.binaryPath;
const extraArgs = parseCliArgs(claudeSettings.launchArgs).flags;
const modelSelection =
input.modelSelection?.provider === "claudeAgent" ? input.modelSelection : undefined;
const caps = getClaudeModelCapabilities(modelSelection?.model);
Expand Down Expand Up @@ -3040,6 +3042,7 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
...(computedAdditionalDirs.length > 0
? { additionalDirectories: computedAdditionalDirs }
: {}),
...(Object.keys(extraArgs).length > 0 ? { extraArgs } : {}),
};

const queryRuntime = yield* Effect.try({
Expand Down
17 changes: 17 additions & 0 deletions apps/server/src/provider/Layers/ClaudeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
promptInjectedEffortLevels: ["ultrathink"],
} satisfies ModelCapabilities,
},
{
slug: "claude-opus-4-5",
name: "Opus 4.5",
isCustom: false,
capabilities: {
reasoningEffortLevels: [
{ value: "low", label: "Low" },
{ value: "medium", label: "Medium" },
{ value: "high", label: "High", isDefault: true },
{ value: "max", label: "Max" },
],
supportsFastMode: true,
supportsThinkingToggle: false,
contextWindowOptions: [],
promptInjectedEffortLevels: [],
} satisfies ModelCapabilities,
},
{
slug: "claude-sonnet-4-6",
name: "Sonnet 4.6",
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/serverSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ it.layer(NodeServices.layer)("server settings", (it) => {
enabled: true,
binaryPath: "/usr/local/bin/claude",
customModels: ["claude-custom"],
launchArgs: "",
});
assert.deepEqual(next.textGenerationModelSelection, {
provider: "codex",
Expand Down Expand Up @@ -167,6 +168,7 @@ it.layer(NodeServices.layer)("server settings", (it) => {
enabled: true,
binaryPath: "/opt/homebrew/bin/claude",
customModels: [],
launchArgs: "",
});
}).pipe(Effect.provide(makeServerSettingsLayer())),
);
Expand Down
31 changes: 30 additions & 1 deletion apps/web/src/components/ChatView.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ vi.mock("../lib/gitStatusState", () => ({
}));

const THREAD_ID = "thread-browser-test" as ThreadId;
const THREAD_TITLE = "Browser test thread";
const ARCHIVED_SECONDARY_THREAD_ID = "thread-secondary-project-archived" as ThreadId;
const PROJECT_ID = "project-1" as ProjectId;
const SECOND_PROJECT_ID = "project-2" as ProjectId;
Expand Down Expand Up @@ -320,7 +321,7 @@ function createSnapshotForTargetUser(options: {
{
id: THREAD_ID,
projectId: PROJECT_ID,
title: "Browser test thread",
title: THREAD_TITLE,
modelSelection: {
provider: "codex",
model: "gpt-5",
Expand Down Expand Up @@ -3304,6 +3305,34 @@ describe("ChatView timeline estimator parity (full app)", () => {
}
});

it("exposes the full thread title on the sidebar row tooltip", async () => {
const mounted = await mountChatView({
viewport: DEFAULT_VIEWPORT,
snapshot: createSnapshotForTargetUser({
targetMessageId: "msg-user-thread-tooltip-target" as MessageId,
targetText: "thread tooltip target",
}),
});

try {
const threadTitle = page.getByTestId(`thread-title-${THREAD_ID}`);

await expect.element(threadTitle).toBeInTheDocument();
await threadTitle.hover();

await vi.waitFor(
() => {
const tooltip = document.querySelector<HTMLElement>('[data-slot="tooltip-popup"]');
expect(tooltip).not.toBeNull();
expect(tooltip?.textContent).toContain(THREAD_TITLE);
},
{ timeout: 8_000, interval: 16 },
);
} finally {
await mounted.cleanup();
}
});

it("shows the confirm archive action after clicking the archive button", async () => {
localStorage.setItem(
"marcode:client-settings:v1",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/KeybindingsToast.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function createBaseServerConfig(): ServerConfig {
textGenerationModelSelection: { provider: "codex" as const, model: "gpt-5.4-mini" },
providers: {
codex: { enabled: true, binaryPath: "", homePath: "", customModels: [] },
claudeAgent: { enabled: true, binaryPath: "", customModels: [] },
claudeAgent: { enabled: true, binaryPath: "", customModels: [], launchArgs: "" },
},
},
};
Expand Down
16 changes: 15 additions & 1 deletion apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
type SidebarProjectGroupingMode,
type ThreadEnvMode,
ThreadId,
type GitStatusResult,

Check warning on line 50 in apps/web/src/components/Sidebar.tsx

View workflow job for this annotation

GitHub Actions / Format, Lint, Typecheck, Test, Browser Test, Build

eslint(no-unused-vars)

Type 'GitStatusResult' is imported but never used.
} from "@marcode/contracts";
import {
scopedProjectKey,
Expand Down Expand Up @@ -205,7 +205,7 @@
separate: "Keep separate",
};

function threadJumpLabelMapsEqual(

Check warning on line 208 in apps/web/src/components/Sidebar.tsx

View workflow job for this annotation

GitHub Actions / Format, Lint, Typecheck, Test, Browser Test, Build

eslint(no-unused-vars)

Function 'threadJumpLabelMapsEqual' is declared but never used.
left: ReadonlyMap<string, string>,
right: ReadonlyMap<string, string>,
): boolean {
Expand Down Expand Up @@ -594,7 +594,21 @@
onClick={handleRenameInputClick}
/>
) : (
<span className="min-w-0 flex-1 truncate text-xs">{thread.title}</span>
<Tooltip>
<TooltipTrigger
render={
<span
className="min-w-0 flex-1 truncate text-xs"
data-testid={`thread-title-${thread.id}`}
>
{thread.title}
</span>
}
/>
<TooltipPopup side="top" className="max-w-80 whitespace-normal leading-tight">
{thread.title}
</TooltipPopup>
</Tooltip>
)}
</div>
<div className="ml-auto flex shrink-0 items-center gap-1.5">
Expand Down
34 changes: 33 additions & 1 deletion apps/web/src/components/settings/SettingsPanels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
PlusIcon,
RefreshCwIcon,
Trash2Icon,
Undo2Icon,

Check warning on line 11 in apps/web/src/components/settings/SettingsPanels.tsx

View workflow job for this annotation

GitHub Actions / Format, Lint, Typecheck, Test, Browser Test, Build

eslint(no-unused-vars)

Identifier 'Undo2Icon' is imported but never used.
UploadIcon,
XIcon,
} from "lucide-react";
Expand All @@ -20,7 +20,7 @@
type ProviderKind,
type ServerProvider,
type ServerProviderModel,
ThreadId,

Check warning on line 23 in apps/web/src/components/settings/SettingsPanels.tsx

View workflow job for this annotation

GitHub Actions / Format, Lint, Typecheck, Test, Browser Test, Build

eslint(no-unused-vars)

Identifier 'ThreadId' is imported but never used.
} from "@marcode/contracts";
import { scopeThreadRef } from "@marcode/client-runtime";
import {
Expand Down Expand Up @@ -939,7 +939,8 @@
claudeAgent: Boolean(
settings.providers.claudeAgent.binaryPath !==
DEFAULT_UNIFIED_SETTINGS.providers.claudeAgent.binaryPath ||
settings.providers.claudeAgent.customModels.length > 0,
settings.providers.claudeAgent.customModels.length > 0 ||
settings.providers.claudeAgent.launchArgs !== "",
),
});
const [customModelInputByProvider, setCustomModelInputByProvider] = useState<
Expand Down Expand Up @@ -1692,6 +1693,37 @@
</div>
) : null}

{providerCard.provider === "claudeAgent" ? (
<div className="border-t border-border/60 px-4 py-3 sm:px-5">
<label htmlFor="provider-install-claudeAgent-launch-args" className="block">
<span className="text-xs font-medium text-foreground">
Launch arguments
</span>
<Input
id="provider-install-claudeAgent-launch-args"
className="mt-1.5"
value={settings.providers.claudeAgent.launchArgs}
onChange={(event) =>
updateSettings({
providers: {
...settings.providers,
claudeAgent: {
...settings.providers.claudeAgent,
launchArgs: event.target.value,
},
},
})
}
placeholder="e.g. --chrome"
spellCheck={false}
/>
<span className="mt-1 block text-xs text-muted-foreground">
Additional CLI arguments passed to Claude Code on session start.
</span>
</label>
</div>
) : null}

<div className="border-t border-border/60 px-4 py-3 sm:px-5">
<div className="text-xs font-medium text-foreground">Models</div>
<div className="mt-1 text-xs text-muted-foreground">
Expand Down
2 changes: 2 additions & 0 deletions packages/contracts/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export const ClaudeSettings = Schema.Struct({
enabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
binaryPath: makeBinaryPathSetting("claude"),
customModels: Schema.Array(Schema.String).pipe(Schema.withDecodingDefault(Effect.succeed([]))),
launchArgs: Schema.String.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
});
export type ClaudeSettings = typeof ClaudeSettings.Type;

Expand Down Expand Up @@ -233,6 +234,7 @@ const ClaudeSettingsPatch = Schema.Struct({
enabled: Schema.optionalKey(Schema.Boolean),
binaryPath: Schema.optionalKey(Schema.String),
customModels: Schema.optionalKey(Schema.Array(Schema.String)),
launchArgs: Schema.optionalKey(Schema.String),
});

export const ServerSettingsPatch = Schema.Struct({
Expand Down
4 changes: 4 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
"./path": {
"types": "./src/path.ts",
"import": "./src/path.ts"
},
"./cliArgs": {
"types": "./src/cliArgs.ts",
"import": "./src/cliArgs.ts"
}
},
"scripts": {
Expand Down
134 changes: 134 additions & 0 deletions packages/shared/src/cliArgs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import { describe, expect, it } from "vitest";

import { parseCliArgs } from "./cliArgs";

describe("parseCliArgs", () => {
it("returns empty result for empty string", () => {
expect(parseCliArgs("")).toEqual({ flags: {}, positionals: [] });
});

it("returns empty result for whitespace-only string", () => {
expect(parseCliArgs(" ")).toEqual({ flags: {}, positionals: [] });
});

it("returns empty result for empty array", () => {
expect(parseCliArgs([])).toEqual({ flags: {}, positionals: [] });
});

it("parses --chrome boolean flag", () => {
expect(parseCliArgs("--chrome")).toEqual({
flags: { chrome: null },
positionals: [],
});
});

it("parses --chrome with --verbose", () => {
expect(parseCliArgs("--chrome --verbose")).toEqual({
flags: { chrome: null, verbose: null },
positionals: [],
});
});

it("parses --effort with a value", () => {
expect(parseCliArgs("--effort high")).toEqual({
flags: { effort: "high" },
positionals: [],
});
});

it("parses --chrome --effort high --debug", () => {
expect(parseCliArgs("--chrome --effort high --debug")).toEqual({
flags: { chrome: null, effort: "high", debug: null },
positionals: [],
});
});

it("parses --model with full model name", () => {
expect(parseCliArgs("--model claude-sonnet-4-6")).toEqual({
flags: { model: "claude-sonnet-4-6" },
positionals: [],
});
});

it("parses --append-system-prompt with value and --chrome", () => {
expect(parseCliArgs("--append-system-prompt always-think-step-by-step --chrome")).toEqual({
flags: { "append-system-prompt": "always-think-step-by-step", chrome: null },
positionals: [],
});
});

it("parses --max-budget-usd with numeric value", () => {
expect(parseCliArgs("--chrome --max-budget-usd 5.00")).toEqual({
flags: { chrome: null, "max-budget-usd": "5.00" },
positionals: [],
});
});

it("parses --effort=high syntax", () => {
expect(parseCliArgs("--effort=high")).toEqual({
flags: { effort: "high" },
positionals: [],
});
});

it("parses --key=value mixed with boolean flags", () => {
expect(parseCliArgs("--chrome --model=claude-sonnet-4-6 --debug")).toEqual({
flags: { chrome: null, model: "claude-sonnet-4-6", debug: null },
positionals: [],
});
});

it("collects positional arguments", () => {
expect(parseCliArgs("1.2.3")).toEqual({
flags: {},
positionals: ["1.2.3"],
});
});

it("collects positionals mixed with flags (argv array)", () => {
expect(parseCliArgs(["1.2.3", "--root", "/path", "--github-output"])).toEqual({
flags: { root: "/path", "github-output": null },
positionals: ["1.2.3"],
});
});

it("handles extra whitespace between tokens", () => {
expect(parseCliArgs(" --chrome --verbose ")).toEqual({
flags: { chrome: null, verbose: null },
positionals: [],
});
});

it("ignores bare -- with no flag name", () => {
expect(parseCliArgs("--")).toEqual({ flags: {}, positionals: [] });
});

it("boolean flag does not consume next token as value", () => {
expect(parseCliArgs(["--github-output", "1.2.3"], { booleanFlags: ["github-output"] })).toEqual(
{
flags: { "github-output": null },
positionals: ["1.2.3"],
},
);
});

it("non-boolean flag still consumes next token", () => {
expect(parseCliArgs(["--root", "/path", "1.2.3"], { booleanFlags: ["github-output"] })).toEqual(
{
flags: { root: "/path" },
positionals: ["1.2.3"],
},
);
});

it("mixes boolean and value flags with positionals", () => {
expect(
parseCliArgs(["--github-output", "--root", "/path", "1.2.3"], {
booleanFlags: ["github-output"],
}),
).toEqual({
flags: { "github-output": null, root: "/path" },
positionals: ["1.2.3"],
});
});
});
Loading
Loading