Skip to content

Conversation

@khulnasoft-bot
Copy link
Contributor

@khulnasoft-bot khulnasoft-bot commented Dec 4, 2025

fix #4 (comment)

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced configuration persistence to properly save memory and error handling settings alongside model preferences in configuration files.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: KhulnaSoft bot <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

The saveConfig function in config.ts now conditionally persists memory and fullAutoErrorMode fields alongside model when present, instead of discarding them. This preserves additional configuration settings in saved files, addressing data loss during round-trip serialization for both YAML and JSON formats.

Changes

Cohort / File(s) Summary
Config persistence fix
axilo-cli/src/utils/config.ts
Modified saveConfig serialization to conditionally include memory and fullAutoErrorMode fields in persisted configuration object for YAML/YML and JSON output formats

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify conditional field inclusion logic for memory and fullAutoErrorMode
  • Confirm both YAML and JSON serialization paths apply identical field selection
  • Check that the optional field pattern matches StoredConfig type definition

Poem

🐰 A config that vanished, now saved with care,
Memory persists, and errors laid bare,
No more fields lost to the void so vast,
Round-trip persistence holds them steadfast!
🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'Update config.ts' is vague and generic, using non-descriptive language that does not convey the specific change being made to the codebase. Provide a more specific title that describes the main change, such as 'Persist all StoredConfig fields in saveConfig' or 'Fix config serialization to include memory and fullAutoErrorMode'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements the required changes from issue #4 by modifying saveConfig to persist memory and fullAutoErrorMode fields alongside model in both YAML/YML and JSON formats.
Out of Scope Changes check ✅ Passed All changes are within scope; the PR only modifies saveConfig serialization logic to persist additional StoredConfig fields as specified in issue #4.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)

✅ Unit Test PR creation complete.

  • Create PR with unit tests
  • Commit unit tests in branch khulnasoft-bot-patch-1
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Note

Unit test generation is an Early Access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@khulnasoft-bot khulnasoft-bot added the wontfix This will not be worked on label Dec 4, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
axilo-cli/src/utils/config.ts (1)

487-495: Consider extracting the duplicated persistence logic.

The YAML and JSON branches have identical logic for building the stored object. This duplication could be eliminated by constructing the object once before the format check.

Apply this diff to reduce duplication:

   const ext = extname(targetPath).toLowerCase();
+  const stored: StoredConfig = { model: config.model };
+  if (config.memory) stored.memory = config.memory;
+  if (config.fullAutoErrorMode) stored.fullAutoErrorMode = config.fullAutoErrorMode;
+
   if (ext === ".yaml" || ext === ".yml") {
-    const stored: StoredConfig = { model: config.model };
-    if (config.memory) stored.memory = config.memory;
-    if (config.fullAutoErrorMode) stored.fullAutoErrorMode = config.fullAutoErrorMode;
     writeFileSync(targetPath, dumpYaml(stored), "utf-8");
   } else {
-    const stored: StoredConfig = { model: config.model };
-    if (config.memory) stored.memory = config.memory;
-    if (config.fullAutoErrorMode) stored.fullAutoErrorMode = config.fullAutoErrorMode;
     writeFileSync(targetPath, JSON.stringify(stored, null, 2), "utf-8");
   }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbbde22 and 8b7a809.

📒 Files selected for processing (1)
  • axilo-cli/src/utils/config.ts (1 hunks)
🔇 Additional comments (2)
axilo-cli/src/utils/config.ts (2)

487-495: Good fix for memory and fullAutoErrorMode persistence.

The implementation correctly addresses the data loss issue for memory and fullAutoErrorMode fields by conditionally including them in the serialized config. The conditional logic ensures backward compatibility with configs that don't have these fields set.


487-495: The changes correctly address the missing field persistence for memory and fullAutoErrorMode.

The fix successfully adds conditional persistence for both memory and fullAutoErrorMode in both YAML and JSON branches. However, note that approvalMode in StoredConfig (line 190) is not part of the load/save cycle—it's a CLI-only flag, not a runtime configuration value. AppConfig (lines 209-214) intentionally excludes approvalMode, and loadConfig only extracts model, memory, and fullAutoErrorMode from stored config. Therefore, approvalMode is not data loss but by design.

Likely an incorrect or invalid review comment.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Note

Unit test generation is an Early Access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

UTG Post-Process Complete

No new issues were detected in the generated code and all check runs have completed. The unit test generation process has completed successfully.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Creating a PR to put the unit tests in...

The changes have been created in this pull request: View PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

UTG Post-Process Complete

No new issues were detected in the generated code and all check runs have completed. The unit test generation process has completed successfully.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Creating a PR to put the unit tests in...

The changes have been created in this pull request: View PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_⚠️ Potential issue_ | _🟠 Major_

2 participants