Skip to content

Commit fbd142d

Browse files
authored
remove ESC key handling complexity; ctrl+c still cancels generation (#519)
* remove ESC key handling complexity; ctrl+c still cancels generation * opus 4.5 support * opus 4.5
1 parent 6e99606 commit fbd142d

File tree

4 files changed

+7
-155
lines changed

4 files changed

+7
-155
lines changed

src/fast_agent/llm/model_database.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ class ModelDatabase:
271271
"claude-sonnet-4-5-20250929": ANTHROPIC_SONNET_4_VERSIONED,
272272
"claude-opus-4-0": ANTHROPIC_OPUS_4_VERSIONED,
273273
"claude-opus-4-1": ANTHROPIC_OPUS_4_VERSIONED,
274+
"claude-opus-4-5": ANTHROPIC_OPUS_4_VERSIONED,
274275
"claude-opus-4-20250514": ANTHROPIC_OPUS_4_VERSIONED,
275276
"claude-haiku-4-5-20251001": ANTHROPIC_SONNET_4_VERSIONED,
276277
"claude-haiku-4-5": ANTHROPIC_SONNET_4_VERSIONED,

src/fast_agent/llm/model_factory.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class ModelFactory:
8484
"claude-3-opus-latest": Provider.ANTHROPIC,
8585
"claude-opus-4-0": Provider.ANTHROPIC,
8686
"claude-opus-4-1": Provider.ANTHROPIC,
87+
"claude-opus-4-5": Provider.ANTHROPIC,
8788
"claude-opus-4-20250514": Provider.ANTHROPIC,
8889
"claude-sonnet-4-20250514": Provider.ANTHROPIC,
8990
"claude-sonnet-4-0": Provider.ANTHROPIC,
@@ -115,13 +116,14 @@ class ModelFactory:
115116
"sonnet45": "claude-sonnet-4-5",
116117
"sonnet35": "claude-3-5-sonnet-latest",
117118
"sonnet37": "claude-3-7-sonnet-latest",
118-
"claude": "claude-sonnet-4-0",
119+
"claude": "claude-sonnet-4-5",
119120
"haiku": "claude-haiku-4-5",
120121
"haiku3": "claude-3-haiku-20240307",
121122
"haiku35": "claude-3-5-haiku-latest",
122123
"hauku45": "claude-haiku-4-5",
123-
"opus": "claude-opus-4-1",
124+
"opus": "claude-opus-4-5",
124125
"opus4": "claude-opus-4-1",
126+
"opus45": "claude-opus-4-5",
125127
"opus3": "claude-3-opus-latest",
126128
"deepseekv3": "deepseek-chat",
127129
"deepseek": "deepseek-chat",

src/fast_agent/ui/interactive_prompt.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
)
1515
"""
1616

17-
import asyncio
18-
import sys
1917
from pathlib import Path
2018
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Union, cast
2119

2220
from fast_agent.constants import CONTROL_MESSAGE_SAVE_HISTORY
23-
from fast_agent.ui.keyboard_interrupt import run_with_esc_cancel
2421

2522
if TYPE_CHECKING:
2623
from fast_agent.core.agent_app import AgentApp
@@ -333,17 +330,8 @@ async def prompt_loop(
333330
if user_input == "":
334331
continue
335332

336-
# Send the message to the agent with ESC cancellation support
337-
# Only enable ESC cancellation if we're in an interactive terminal
338-
if sys.stdin.isatty():
339-
try:
340-
result = await run_with_esc_cancel(send_func(user_input, agent))
341-
except asyncio.CancelledError:
342-
rich_print("\n[yellow]Request cancelled by user (ESC)[/yellow]")
343-
result = "[Cancelled]"
344-
continue
345-
else:
346-
result = await send_func(user_input, agent)
333+
# Send the message to the agent
334+
result = await send_func(user_input, agent)
347335

348336
return result
349337

src/fast_agent/ui/keyboard_interrupt.py

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)