Thinking levels: Tab cycles off/low/medium/high, /effort

This commit is contained in:
hermes committed 2026-10-06 12:05:29 +00:00
1 parent 2f1ce2c072
commit ab2af421a4
9 files changed
+180 -16

No files matched your search

+12
View File
@@ -32,6 +32,7 @@ pub struct Agent {
model: String,
system: String,
max_tokens: u32,
effort: hx_ai::Effort,
max_turns: u32,
usage: Usage,
session: Session,
@@ -71,6 +72,7 @@ impl Agent {
model: String::new(),
system: String::new(),
max_tokens: 16_384,
effort: hx_ai::Effort::Off,
max_turns: 200,
usage: Usage::default(),
session,
@@ -107,6 +109,15 @@ impl Agent {
self.model = model.into();
}
pub fn effort(&self) -> hx_ai::Effort {
self.effort
}
/// Thinking level for the following requests.
pub fn set_effort(&mut self, e: hx_ai::Effort) {
self.effort = e;
}
pub fn set_system(&mut self, system: impl Into<String>) {
self.system = system.into();
}
@@ -239,6 +250,7 @@ impl Agent {
messages: view.messages,
tools: self.tools.specs(),
max_tokens: self.max_tokens,
effort: self.effort,
};
let mut s = self.provider.stream(req).await?;
let mut done = None;
+5
View File
@@ -56,6 +56,11 @@ pub fn builtins(models: &[&str]) -> Vec<CmdSpec> {
"switch provider",
Enum(vec!["claude".into(), "codex".into()]),
),
b(
"effort",
"thinking level (tab on an empty line cycles)",
Enum(["off", "low", "medium", "high"].map(String::from).into()),
),
b("compact", "summarize old context", None),
b("new", "start a new session (old one stays resumable)", None),
b("clear", "alias of /new", None),
+1
View File
@@ -43,6 +43,7 @@ impl Plan {
messages: vec![Message::user(self.transcript.clone())],
tools: vec![],
max_tokens: 4096,
effort: hx_ai::Effort::Off,
}
}