Description
Running commit-echo config set <key> <value> rebuilds the persisted config from loadRawConfig() but omits templatePath, so any config set invocation silently erases the custom prompt-template-file setting. The value also cannot be restored with config set because templatePath is not in CONFIG_SET_KEYS — the user must re-run init.
Location
src/commands/config.ts lines 230–240 (configSetCommand)
Code
const config = await loadRawConfig();
const nextConfig: Config = {
provider: config.provider ?? '',
model: config.model ?? '',
baseUrl: config.baseUrl,
apiKey: config.apiKey,
historySize: config.historySize ?? DEFAULT_HISTORY_SIZE,
maxDiffSize: config.maxDiffSize ?? DEFAULT_MAX_DIFF_SIZE,
systemPromptTemplate: config.systemPromptTemplate,
userPromptTemplate: config.userPromptTemplate,
// templatePath is never copied → dropped on save
};
Config (types.ts) and loadConfig() (config/store.ts:190) both support templatePath, and init writes it, so this is an inconsistency in the config set path.
Suggested fix
Include templatePath: config.templatePath in nextConfig, and add templatePath to CONFIG_SET_KEYS (with validation that the path exists) so it can be managed via config set like the other template settings.
Impact
Users who use a custom template file lose their configuration whenever they run config set for any unrelated key (e.g. config set model gpt-4o), and their prompts silently fall back to the built-in ones with no warning.
Description
Running
commit-echo config set <key> <value>rebuilds the persisted config fromloadRawConfig()but omitstemplatePath, so anyconfig setinvocation silently erases the custom prompt-template-file setting. The value also cannot be restored withconfig setbecausetemplatePathis not inCONFIG_SET_KEYS— the user must re-runinit.Location
src/commands/config.tslines 230–240 (configSetCommand)Code
Config(types.ts) andloadConfig()(config/store.ts:190) both supporttemplatePath, andinitwrites it, so this is an inconsistency in theconfig setpath.Suggested fix
Include
templatePath: config.templatePathinnextConfig, and addtemplatePathtoCONFIG_SET_KEYS(with validation that the path exists) so it can be managed viaconfig setlike the other template settings.Impact
Users who use a custom template file lose their configuration whenever they run
config setfor any unrelated key (e.g.config set model gpt-4o), and their prompts silently fall back to the built-in ones with no warning.