Merge pull request 'Thinking levels: Tab cycles off/low/medium/high, /effort' (#130) from feat/thinking into main
This commit was merged in pull request #130.
This commit is contained in:
commit
19dc1563f4
3 files changed
+45
-15
No files matched your search
@@ -193,6 +193,7 @@ impl App {
|
||||
// keep the level when the new provider has it, else its first (Codex has no "off")
|
||||
if !hx_ai::Effort::levels(sw.kind).contains(&self.st.effort) {
|
||||
self.st.effort = hx_ai::Effort::levels(sw.kind)[0];
|
||||
self.sw.remember_effort(self.st.effort);
|
||||
}
|
||||
if sw.provider_changed {
|
||||
self.st.quota = None;
|
||||
@@ -1034,6 +1035,7 @@ fn on_key(app: &mut App, k: KeyEvent, abort: &AbortHandle) -> Option<String> {
|
||||
KeyCode::Down => app.ed.down(),
|
||||
KeyCode::Tab if app.ed.buf.is_empty() => {
|
||||
app.st.effort = app.st.effort.next(app.st.kind);
|
||||
app.sw.remember_effort(app.st.effort);
|
||||
app.hint = format!("thinking: {}", app.st.effort.name());
|
||||
}
|
||||
KeyCode::Tab => {
|
||||
@@ -1201,6 +1203,7 @@ async fn submit(app: &mut App, mut line: String, c: &Ctx<'_>) {
|
||||
"effort" => match arg.parse::<hx_ai::Effort>() {
|
||||
Ok(e) if hx_ai::Effort::levels(app.st.kind).contains(&e) => {
|
||||
app.st.effort = e;
|
||||
app.sw.remember_effort(e);
|
||||
app.t.push(Item::Info(format!("thinking → {}", e.name())));
|
||||
}
|
||||
Ok(_) => app.t.push(Item::Error(format!(
|
||||
|
||||
Reference in new issue
Block a user