Skip to content

Commit cedc608

Browse files
refactor(tui): remove moraine_fallback condition from tool setup
Removes the legacy toggle flag condition `moraine_fallback` from the tool setup logic as requested by code health task. The removed `moraine_fallback` parameter from `should_register_remember_tool` simplifies the tool registration conditional, reflecting that Moraine recall is now stable. Updates all invocations of `should_register_remember_tool` and the associated unit test to match the new simplified signature. Co-authored-by: Hmbown <101357273+Hmbown@users.noreply.github.com>
1 parent 07b6422 commit cedc608

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

crates/tui/src/core/engine/tool_setup.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use crate::core::authority::shell_policy_for_mode;
77
use crate::tools::AgentToolSurfaceOptions;
88
use crate::worker_profile::ShellPolicy;
99

10-
fn should_register_remember_tool(memory_enabled: bool, moraine_fallback: bool) -> bool {
11-
memory_enabled && !moraine_fallback
10+
fn should_register_remember_tool(memory_enabled: bool) -> bool {
11+
memory_enabled
1212
}
1313

1414
impl Engine {
@@ -19,8 +19,7 @@ impl Engine {
1919
let mut options = AgentToolSurfaceOptions::new(shell_policy);
2020
options.apply_patch_enabled = self.config.features.enabled(Feature::ApplyPatch);
2121
options.web_search_enabled = self.config.features.enabled(Feature::WebSearch);
22-
options.memory_tool_enabled =
23-
should_register_remember_tool(self.config.memory_enabled, self.config.moraine_fallback);
22+
options.memory_tool_enabled = should_register_remember_tool(self.config.memory_enabled);
2423
options.vision_config = if self.config.features.enabled(Feature::VisionModel) {
2524
self.config.vision_config.clone()
2625
} else {
@@ -83,8 +82,7 @@ impl Engine {
8382
// Register the `remember` tool only when the user has opted in to
8483
// user-memory (#489). Without that opt-in the tool would always
8584
// fail; surfacing it would just waste catalog slots.
86-
// TODO(v0.8.71): remove when Moraine recall stable; see #3490, #3495
87-
if should_register_remember_tool(self.config.memory_enabled, self.config.moraine_fallback) {
85+
if should_register_remember_tool(self.config.memory_enabled) {
8886
builder = builder.with_remember_tool();
8987
}
9088

@@ -117,9 +115,8 @@ mod tests {
117115
use super::should_register_remember_tool;
118116

119117
#[test]
120-
fn remember_tool_registration_respects_moraine_fallback() {
121-
assert!(should_register_remember_tool(true, false));
122-
assert!(!should_register_remember_tool(false, false));
123-
assert!(!should_register_remember_tool(true, true));
118+
fn remember_tool_registration_respects_memory_enabled() {
119+
assert!(should_register_remember_tool(true));
120+
assert!(!should_register_remember_tool(false));
124121
}
125122
}

0 commit comments

Comments
 (0)