返回 DeepSeek-TUI-2026
handoff.rs
根目录 / crates / tui / src / handoff.rs
1 // Used by the deferred context-limit handoff feature (#667). The implementation
2 // path is staged but not yet wired from the engine; suppress dead-code warnings
3 // rather than delete the table until the follow-up feature consumes it.
4 #[allow(dead_code)]
5 pub const THRESHOLDS: [(f32, &str); 3] = [
6 (
7 0.9,
8 "Context at 90%: stop and write handoff to .deepseek/handoff.md now",
9 ),
10 (0.8, "Context at 80%: draft handoff to .deepseek/handoff.md"),
11 (0.7, "Context at 70%: consider wrapping current sub-task"),
12 ];
13 #[allow(dead_code)]
14 pub fn threshold_message(ratio: f32) -> Option<&'static str> {
15 THRESHOLDS
16 .iter()
17 .find(|(t, _)| ratio >= *t)
18 .map(|(_, m)| *m)
19 }
20
20 lines RUST