Skip to content
Draft
8 changes: 6 additions & 2 deletions src/main/agent-launch/agent-launch-executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ describe('caller-supplied launch inputs', () => {
const result = await h.run({ agent: 'claude', target: EXISTING, agentArgs: '--model opus' })

expect(result.outcome.kind).toBe('structured')
expect(result.warning).toContain('per-launch argument override was ignored')
expect(result.warning).toBe(
"Started a structured chat session, which doesn't use launch arguments; the per-launch override was ignored."
)
})

it('warns when a structured session ignored an explicit "no arguments" too', async () => {
Expand All @@ -640,7 +642,9 @@ describe('caller-supplied launch inputs', () => {
// The structured path reads the bypass-permissions bit from the user's SETTINGS default, so a
// caller that asked for no arguments can still get a session with more permission than it asked
// for. Staying silent about that is the failure mode worth a test.
expect(result.warning).toContain('per-launch argument override was ignored')
expect(result.warning).toBe(
"Started a structured chat session, which doesn't use launch arguments; the per-launch override was ignored."
)
})

it('leaves a structured launch unwarned when it carried no arguments at all', async () => {
Expand Down
6 changes: 2 additions & 4 deletions src/main/agent-launch/agent-launch-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,15 @@ async function createSurface(
return createTerminalSurface(execution, workspace)
}

/**
* Structured chat uses saved Arguments, so a per-call override still needs a truthful warning.
*/
/** A structured chat takes no launch arguments, saved or per-call, so an override gets a warning. */
function ignoredStructuredAgentArgsWarning(
intent: AgentLaunchIntent
): { warning: string } | undefined {
return intent.agentArgs === undefined
? undefined
: {
warning:
'Started a structured chat session using saved agent Arguments; the per-launch argument override was ignored.'
"Started a structured chat session, which doesn't use launch arguments; the per-launch override was ignored."
}
}

Expand Down
13 changes: 4 additions & 9 deletions src/main/claude/claude-agent-sdk-contract-pins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ function resolvedLaunch(permissionMode: PermissionMode, launchArgs: string[] = [
launchArgs
} as unknown as AgentSessionRecord
return createClaudeStructuredLaunchResolver({
resolveLaunchArgs: () => launchArgs,
store: { getRecord: () => record, pinLaunchDirectory: vi.fn() },
resolveWorkspacePath: async () => '/repos/workspace-1',
resolveCommand: () => FAKE_CLI,
Expand Down Expand Up @@ -329,7 +328,8 @@ describe('Claude Agent SDK contract pins', () => {
const scenario = scriptScenario([{ awaitUserMessage: true }, { emit: RESULT_FRAME }])
const spawns: SpawnSeen[] = []
// Driven by the real resolver, so the argv walk covers its option set and merge order,
// not a hand-written options literal.
// not a hand-written options literal. The record carries launch arguments as an older build
// stored them: the launch ignores them, as it ignores saved Arguments.
const launch = await resolvedLaunch('bypassPermissions', [
'--model',
'claude-sonnet-4-5',
Expand Down Expand Up @@ -358,13 +358,8 @@ describe('Claude Agent SDK contract pins', () => {
expect(argv.filter((arg) => arg === '--dangerously-skip-permissions')).toHaveLength(1)
expect(argv).not.toContain('--allow-dangerously-skip-permissions')
expect(argv[argv.indexOf('--permission-mode') + 1]).toBe('default')
expect(argv[argv.indexOf('--model') + 1]).toBe('claude-sonnet-4-5')
expect(argv.flatMap((arg, index) => (arg === '--add-dir' ? [argv[index + 1]] : []))).toEqual([
'/repo/one',
'/repo/two',
'/repo/three'
])
expect(argv.filter((arg) => arg === '--model')).toHaveLength(1)
expect(argv).not.toContain('--model')
expect(argv).not.toContain('--add-dir')
expect(argv.filter((arg) => arg === '--output-format')).toHaveLength(1)
expect(argv[argv.indexOf('--output-format') + 1]).toBe('stream-json')
// Headless print mode is the SDK's only mode; `query()` never passes `-p`,
Expand Down
1 change: 0 additions & 1 deletion src/main/claude/claude-structured-auth-parity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function resolverFor(options: {
overlay?: Record<string, string>
}): ReturnType<typeof createClaudeStructuredLaunchResolver> {
return createClaudeStructuredLaunchResolver({
resolveLaunchArgs: () => [],
store: { getRecord: () => record(), pinLaunchDirectory: vi.fn() },
resolveWorkspacePath: async (id) => `/repos/${id}`,
resolveCommand: () => '/usr/local/bin/claude',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ it('launches each acquisition under the current selection, not the account it wa
}
const resolve = createClaudeStructuredLaunchResolver({
store: { getRecord: () => record, pinLaunchDirectory: vi.fn() },
resolveLaunchArgs: () => [],
resolveWorkspacePath: async (id) => `/repos/${id}`,
resolveCommand: () => '/usr/local/bin/claude',
resolveInheritedEnv: async () => ({ PATH: '/usr/bin' }),
Expand Down Expand Up @@ -111,7 +110,6 @@ function routedResumeFixture() {
const transcriptHomes = new Set<string>()
const resolve = createClaudeStructuredLaunchResolver({
store: { getRecord: () => record, pinLaunchDirectory: vi.fn() },
resolveLaunchArgs: () => [],
resolveWorkspacePath: async (id) => `/repos/${id}`,
resolveCommand: () => '/usr/local/bin/claude',
resolveInheritedEnv: async () => ({ PATH: '/usr/bin' }),
Expand Down
90 changes: 0 additions & 90 deletions src/main/claude/claude-structured-launch-args.test.ts

This file was deleted.

85 changes: 0 additions & 85 deletions src/main/claude/claude-structured-launch-args.ts

This file was deleted.

Loading