Skip to content

[Reliability] config set silently drops the templatePath setting from config #283

Description

@404-Page-Found

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions