refactor: Simplify thinking token budget display logic

This commit is contained in:
Paul Gauthier 2025-03-11 11:33:45 -07:00 committed by Paul Gauthier (aider)
parent 2d623ff196
commit 98b3722a02

View file

@ -1421,12 +1421,8 @@ class Commands:
model = self.coder.main_model
model.set_thinking_tokens(value)
# Try to display the actual value that was set
if model.extra_params and "thinking" in model.extra_params:
budget = model.extra_params["thinking"].get("budget_tokens")
self.io.tool_output(f"Set thinking token budget to {budget:,} tokens.")
else:
self.io.tool_output(f"Set thinking token budget to {value}.")
budget = model.extra_params["thinking"].get("budget_tokens")
self.io.tool_output(f"Set thinking token budget to {budget:,} tokens.")
def cmd_copy_context(self, args=None):
"""Copy the current chat context as markdown, suitable to paste into a web UI"""