Merge ticket 052: allow clearing all params and re-extracting from ingested logs
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
@@ -600,6 +600,26 @@ impl Settings {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Empties `profile_name`'s stored param declarations, persisting settings — the counterpart to
|
||||
/// `record_param_declaration` for `DELETE /api/params` (ticket 052). A profile only ever stores
|
||||
/// manually-declared params (auto-derived ones live only in the engine, never persisted here), so
|
||||
/// this is enough to keep the whole set from reappearing on next load; the engine-side clear
|
||||
/// re-derives whatever auto params the retained log text still supports.
|
||||
pub fn clear_param_declarations(
|
||||
&mut self,
|
||||
settings_path: &Path,
|
||||
profile_name: &str,
|
||||
) -> Result<(), ProfileError> {
|
||||
let profile = self
|
||||
.profiles
|
||||
.iter_mut()
|
||||
.find(|p| p.name == profile_name)
|
||||
.ok_or(ProfileError::NotFound)?;
|
||||
profile.params.clear();
|
||||
self.save(settings_path)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Records/updates a declared param into `profile_name`'s stored declarations (matched by param
|
||||
/// name), persisting settings. Intended to be called by the HTTP API alongside declaring against
|
||||
/// the engine, so declarations survive a restart.
|
||||
|
||||
Reference in New Issue
Block a user