aboutsummaryrefslogtreecommitdiff
path: root/src/config/model.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-23 21:27:26 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-23 21:37:05 +0300
commitdb67e9d74ffafc9c63bdf78fcf712419359f634b (patch)
tree9d181b55e65aaf6a2fad2d6cf785bb09a8d9748f /src/config/model.rs
parent1bab1d2ce21507747ea1f506fb891fe7cd5a13c9 (diff)
feat: restore agent sessions
refs #233
Diffstat (limited to 'src/config/model.rs')
-rw-r--r--src/config/model.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config/model.rs b/src/config/model.rs
index 68a55b0f..8894b300 100644
--- a/src/config/model.rs
+++ b/src/config/model.rs
@@ -72,6 +72,14 @@ pub struct TerminalConfig {
pub new_cwd: NewTerminalCwdConfig,
}
+#[derive(Debug, Default, Deserialize)]
+#[serde(default)]
+pub struct SessionConfig {
+ /// Resume supported AI-agent panes into their native conversation sessions
+ /// when restoring a Herdr session. Default: false.
+ pub resume_agents_on_restore: bool,
+}
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ConfigReloadStatus {
@@ -105,6 +113,7 @@ pub struct Config {
pub onboarding: Option<bool>,
pub theme: ThemeConfig,
pub terminal: TerminalConfig,
+ pub session: SessionConfig,
pub keys: KeysConfig,
pub ui: UiConfig,
pub worktrees: WorktreesConfig,
@@ -490,6 +499,19 @@ new_cwd = "~/Projects"
}
#[test]
+ fn resume_agents_on_restore_defaults_off_and_parses() {
+ let default_config = Config::default();
+ assert!(!default_config.session.resume_agents_on_restore);
+
+ let toml = r#"
+[session]
+resume_agents_on_restore = true
+"#;
+ let config: Config = toml::from_str(toml).unwrap();
+ assert!(config.session.resume_agents_on_restore);
+ }
+
+ #[test]
fn agent_panel_scope_config_parses() {
let toml = r#"
[ui]