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
11 changes: 11 additions & 0 deletions src/cli/commands/add/__tests__/validate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1583,4 +1583,15 @@ describe('validateAddAgentOptions - session storage mount path', () => {
const result = validateAddAgentOptions({ ...baseOptions });
expect(result.valid).toBe(true);
});

it('rejects session storage for TypeScript agents', () => {
const result = validateAddAgentOptions({
...baseOptions,
language: 'TypeScript',
framework: 'Strands',
sessionStorageMountPath: '/mnt/data',
});
expect(result.valid).toBe(false);
expect(result.error).toBe('--session-storage-mount-path is not supported for TypeScript agents');
});
});
7 changes: 6 additions & 1 deletion src/cli/commands/add/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ export function validateAddAgentOptions(options: AddAgentOptions): ValidationRes
(matchEnumValue(TargetLanguageSchema, options.language) as typeof options.language) ?? options.language;
if (options.build) options.build = matchEnumValue(BuildTypeSchema, options.build) ?? options.build;

// Session storage is not supported for TypeScript agents — reject early before any path-specific returns
if (options.sessionStorageMountPath && options.language === 'TypeScript') {
return { valid: false, error: '--session-storage-mount-path is not supported for TypeScript agents' };
}

if (!options.name) {
return { valid: false, error: '--name is required' };
}
Expand Down Expand Up @@ -285,7 +290,7 @@ export function validateAddAgentOptions(options: AddAgentOptions): ValidationRes
if (lifecycleResult.idleTimeout !== undefined) options.idleTimeout = lifecycleResult.idleTimeout;
if (lifecycleResult.maxLifetime !== undefined) options.maxLifetime = lifecycleResult.maxLifetime;

// Validate session storage mount path
// Validate session storage mount path format (TypeScript rejection is handled at the top)
if (options.sessionStorageMountPath) {
const mountPathResult = SessionStorageSchema.shape.mountPath.safeParse(options.sessionStorageMountPath);
if (!mountPathResult.success) {
Expand Down
6 changes: 4 additions & 2 deletions src/cli/tui/screens/generate/GenerateWizardUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ export function GenerateWizardUI({
const isSessionStorageMountPathStep = wizard.step === 'sessionStorageMountPath';
const isConfirmStep = wizard.step === 'confirm';

// Advanced multi-select items — filter out dockerfile when not a Container build
// Advanced multi-select items — filter out options not applicable to current config
const advancedItems: SelectableItem[] = ADVANCED_SETTING_OPTIONS.filter(
o => o.id !== 'dockerfile' || wizard.config.buildType === 'Container'
o =>
(o.id !== 'dockerfile' || wizard.config.buildType === 'Container') &&
(o.id !== 'filesystem' || wizard.config.language !== 'TypeScript')
).map(o => ({ id: o.id, title: o.title, description: o.description }));

const handleSelect = (item: SelectableItem) => {
Expand Down
Loading