Description
handle_worktree_command in src/commands/worktree.rs calls Config::load().unwrap_or_default(). When the user passes a config with only a [worktree] section (e.g. a minimal test config), the TOML parse fails because Config has non-defaulted required fields (agent, llm, etc.). unwrap_or_default() silently falls back to the default config, which has worktree.enabled = false, causing the confusing error:
Error: worktree subsystem is disabled. Set `worktree.enabled = true` in your config.
even though the user did set enabled = true.
Reproduction Steps
- Create
/tmp/wt.toml with only [worktree]\nenabled = true\n
- Run
zeph --config /tmp/wt.toml worktree list
- Observe: error says disabled despite
enabled = true
Expected Behavior
A config parse error should be propagated to the user with a clear message, or the worktree command should accept a config file with only the worktree section (all other fields default).
Actual Behavior
unwrap_or_default() silently swallows the parse error and falls back to default config with worktree.enabled = false.
Fix
Replace Config::load(&config_file).unwrap_or_default() with a proper error-propagating call and surface the parse error to the user.
Environment
- Version: 0.21.3 (88145ab)
- Features: default
Logs / Evidence
[FAIL] config.parse (0 ms) failed to parse config file: TOML parse error at line 1, column 1
1 | [worktree]
Description
handle_worktree_commandinsrc/commands/worktree.rscallsConfig::load().unwrap_or_default(). When the user passes a config with only a[worktree]section (e.g. a minimal test config), the TOML parse fails becauseConfighas non-defaulted required fields (agent,llm, etc.).unwrap_or_default()silently falls back to the default config, which hasworktree.enabled = false, causing the confusing error:even though the user did set
enabled = true.Reproduction Steps
/tmp/wt.tomlwith only[worktree]\nenabled = true\nzeph --config /tmp/wt.toml worktree listenabled = trueExpected Behavior
A config parse error should be propagated to the user with a clear message, or the worktree command should accept a config file with only the worktree section (all other fields default).
Actual Behavior
unwrap_or_default()silently swallows the parse error and falls back to default config withworktree.enabled = false.Fix
Replace
Config::load(&config_file).unwrap_or_default()with a proper error-propagating call and surface the parse error to the user.Environment
Logs / Evidence