Skip to content

Fix: Crash when config file missing#20

Open
redwing509 wants to merge 1 commit intoApexOpsStudio:mainfrom
redwing509:autoclaw/issue-2-config-crash-fix
Open

Fix: Crash when config file missing#20
redwing509 wants to merge 1 commit intoApexOpsStudio:mainfrom
redwing509:autoclaw/issue-2-config-crash-fix

Conversation

@redwing509
Copy link

Summary

  • Fixes FileNotFoundError crash when ~/.config/task-cli/config.yaml doesn't exist
  • load_config() now auto-creates a sensible default config file with parent directories
  • Integrates config loading into main() so it runs on every command
  • Adds 4 new tests covering the missing config scenario
  • Updates README to document the auto-creation behavior

Closes #2

Changes

File Change
task.py Rewrites load_config() with graceful fallback, adds DEFAULT_CONFIG, get_config_path()
test_task.py Adds 4 tests: default creation, existing config, parent dirs, CLI no-crash
README.md Updated Configuration section

Test plan

  • All 6 tests pass (pytest test_task.py -v)
  • CLI doesn't crash when config is missing
  • Default config is created automatically on first run
  • Existing custom configs are preserved (not overwritten)

🤖 Generated with Claude Code

load_config() now creates a sensible default config at
~/.config/task-cli/config.yaml when the file doesn't exist, instead of
crashing with FileNotFoundError. Also integrates config loading into main()
so it runs on every command invocation. Adds 4 tests covering the missing
config scenario. Closes ApexOpsStudio#2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: Crash when config file missing

1 participant