Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR relocates settings.toml loading to the current working directory, updates tests accordingly, and includes an example settings file in release artifacts.
- Switch from
Settings::from_path(model_dir)toSettings::load(), which looks in the CWD - Adjust tests to manipulate CWD using the
current_dircrate - Update CLI entrypoint and release workflow to include
assets/settings.toml
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/settings.rs | Replaced from_path with load; adjusted internal logic |
| src/commands.rs | Updated command handler to call Settings::load() |
| Cargo.toml | Added current_dir to dev-dependencies |
| .github/workflows/release.yml | Copy assets/settings.toml into the release artifact bundle |
Comments suppressed due to low confidence (3)
src/settings.rs:30
- The doc comment still refers to
from_pathandmodel_dir. Update it to describeSettings::load()and its behavior (loading from the CWD or returning default).
/// The program settings as a `Settings` struct or an error if the file is invalid
src/settings.rs:50
- [nitpick] The test name still references
from_path; consider renaming totest_settings_load_no_fileto match the newloadmethod.
fn test_settings_from_path_no_file() {
src/settings.rs:58
- [nitpick] Update this test name to
test_settings_loadso it aligns with the updatedSettings::load()method.
fn test_settings_from_path() {
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #637 +/- ##
=======================================
Coverage 88.46% 88.47%
=======================================
Files 39 39
Lines 3555 3558 +3
Branches 3555 3558 +3
=======================================
+ Hits 3145 3148 +3
Misses 219 219
Partials 191 191 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Looks reasonable I think. I'm still not super convinced that we actually need |
We could get rid of it. But whatever we decide to do with it, I'd like for user settings not to live with model data 😛 |
Description
I've been looking at the agent investment stuff and it's making my brain hurt, so I thought I'd change tack and do this issue that's been bothering me for a while. We currently keep
settings.tomlwith model configuration files, but really it's for program settings (cf.model.tomlwhich contains actual parameters), so it should live somewhere else. For now, I've just changed things so thatmuse2looks forsettings.tomlin the CWD because that was the simplest option, though we could do something cleverer at some point if we want (#255).I also thought it makes sense to bundle an example
settings.tomlfile with the releases (althoughmuse2will also run fine if it's not present).Running some of the tests now have to change the CWD, so I'm using this external crate to do this safely.
Closes #513.
Type of change
Key checklist
$ cargo test$ cargo docFurther checks