fix(config): align SDK runtime-state key validation with CJS

This commit is contained in:
Tom Boucher
2026-05-06 15:19:34 -04:00
parent 9ae4426ebb
commit a1a81eec90
5 changed files with 42 additions and 11 deletions

View File

@@ -23,7 +23,7 @@ import { homedir } from 'node:os';
import { join } from 'node:path';
import { GSDError, ErrorClassification } from '../errors.js';
import { VALID_PROFILES, getAgentToModelMapForProfile } from './config-query.js';
import { VALID_CONFIG_KEYS, DYNAMIC_KEY_PATTERNS } from './config-schema.js';
import { VALID_CONFIG_KEYS, RUNTIME_STATE_KEYS, DYNAMIC_KEY_PATTERNS } from './config-schema.js';
import { planningPaths } from './helpers.js';
import { acquireStateLock, releaseStateLock } from './state-mutation.js';
import { maskIfSecret } from './secrets.js';
@@ -86,6 +86,7 @@ const CONFIG_KEY_SUGGESTIONS: Record<string, string> = {
*/
export function isValidConfigKey(keyPath: string): { valid: boolean; suggestion?: string } {
if (VALID_CONFIG_KEYS.has(keyPath)) return { valid: true };
if (RUNTIME_STATE_KEYS.has(keyPath)) return { valid: true };
// Dynamic patterns — all sourced from shared config-schema (#2653).
// Covers agent_skills.*, review.models.*, features.*,