feat(config): add execution context profiles for mode-specific agent output (#1827)

* feat(config): add execution context profiles for mode-specific agent output

* fix(config): add enum validation for context config key

Validate context values against allowed enum (dev, research, review)
in cmdConfigSet before writing to config.json, matching the pattern
used for model_profile validation. Add rejection test for invalid
context values.
This commit is contained in:
Rezolv
2026-04-05 19:09:19 -04:00
committed by GitHub
parent f25ae33dff
commit e107b4e225
6 changed files with 138 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ const VALID_CONFIG_KEYS = new Set([
'workflow.subagent_timeout',
'hooks.context_warnings',
'features.thinking_partner',
'context',
'project_code', 'phase_naming',
'manager.flags.discuss', 'manager.flags.plan', 'manager.flags.execute',
'response_language',
@@ -337,6 +338,11 @@ function cmdConfigSet(cwd, keyPath, value, raw) {
try { parsedValue = JSON.parse(value); } catch { /* keep as string */ }
}
const VALID_CONTEXT_VALUES = ['dev', 'research', 'review'];
if (keyPath === 'context' && !VALID_CONTEXT_VALUES.includes(String(parsedValue))) {
error(`Invalid context value '${value}'. Valid values: ${VALID_CONTEXT_VALUES.join(', ')}`);
}
const setConfigValueResult = setConfigValue(cwd, keyPath, parsedValue);
output(setConfigValueResult, raw, `${keyPath}=${parsedValue}`);
}