Skip to content

init: Remove agent-mode and log-file defaults from questionnaire#14

Merged
iyaki merged 3 commits into
mainfrom
main_init
Jun 17, 2026
Merged

init: Remove agent-mode and log-file defaults from questionnaire#14
iyaki merged 3 commits into
mainfrom
main_init

Conversation

@iyaki

@iyaki iyaki commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

Per the requirement, the ralph init command now always shows NO default for agent-mode and log-file fields in the interactive questionnaire, even when an existing config file contains these values.

Changes

  • internal/cli/init.go: Modified seedInitStringDefaults() to intentionally omit AgentMode and LogFile from seeding
  • Tests updated: Verified that these fields remain empty while other fields (Model, SpecsDir, etc.) continue to preserve their existing config values as defaults

Testing

✅ All existing tests pass
✅ Updated TestSeedInitStringDefaults to validate fields are NOT seeded
✅ Updated TestInitCommandSeedsQuestionDefaultsFromExistingConfig to reflect new behavior

Behavior

Before: Existing config values for agent-mode and log-file were shown as defaults
After: These fields always show empty/no default; logging questions only appear when user provides non-empty log path

Other fields (model, specs-dir, etc.) continue to show their existing values as defaults.

The ralph init command now always shows NO default for agent-mode and
log-file fields in the interactive questionnaire, even when an existing
config file contains these values. This ensures users explicitly choose
whether to set these optional fields on each run.

Changes:
- seedInitStringDefaults(): Intentionally omit AgentMode and LogFile
  from seeding while keeping other string fields (Model, SpecsDir, etc.)
- Tests updated to reflect new behavior where these fields remain empty

Other fields continue to preserve their existing config values as defaults.
Logging questions (truncate?) only appear when user provides non-empty log path.
iyaki added 2 commits June 17, 2026 02:17
Added tests to maintain 95%+ coverage requirement:
- TestAskSingleQuestionWithReaderSuccess
- TestReadBoolFlagOverrideForTest
- TestReadEnvFlagOverridesForTest
- TestAskQuestionsSuccess
- TestStandardQuestionnaireRunnerAskQuestions
- TestAskSingleQuestion

These tests cover questionnaire runner methods and exported test helpers.
@iyaki iyaki merged commit 6378696 into main Jun 17, 2026
12 checks passed
@iyaki iyaki deleted the main_init branch June 17, 2026 02:30
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.

1 participant