ask-agent 0.25.5 → 0.25.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/ask/agent/loop.rb +17 -0
- data/lib/ask/agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b0ae07fe535ce2c8f33a24f145440bee62e70869d1d1f5cd0eb0cf71cb4b4e2f
|
|
4
|
+
data.tar.gz: ecb0c237a7b068f854547081b58c659e9b6735cc8d1d1c3f00936f3e0d24037e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3d254d5ff2f50ad781e98b087b54c4d085ff36c360970d64106ed1adcbbea926cf07e1f7603bb3a538d9ae7e72a1f2f781b1f0951510258eced384ab797a09d
|
|
7
|
+
data.tar.gz: 7be070f08f92a3c8db2897730bbf833d8942f82c154be0f23b6fd6be28a27764ddc56313c1fce837646eb551786876eaff2d1d7e846ea27da4102704d7e58100
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [0.25.6] - 2026-08-05
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- **The agent loop honors `Session#abort` (barge-in).** Aborting a running
|
|
6
|
+
session now stops the loop as soon as the in-flight LLM call ends: no
|
|
7
|
+
tool execution, no follow-up turns, and recursion stops after a tool
|
|
8
|
+
turn. Voice callers who interrupt the agent get their new turn processed
|
|
9
|
+
immediately instead of waiting for the stale answer to finish. Emitters
|
|
10
|
+
without `abort_requested?` (plain stubs) are treated as never aborted.
|
|
11
|
+
|
|
1
12
|
## [0.25.5] - 2026-08-05
|
|
2
13
|
|
|
3
14
|
### Changed
|
data/lib/ask/agent/loop.rb
CHANGED
|
@@ -50,6 +50,14 @@ module Ask
|
|
|
50
50
|
event_emitter.emit(Events::MessageEnd.new(tool_calls: response.tool_call?))
|
|
51
51
|
@turn_count += 1
|
|
52
52
|
|
|
53
|
+
# Barge-in abort: stop as soon as the in-flight LLM call ends — no
|
|
54
|
+
# tool execution, no follow-up turns. The reply so far is returned
|
|
55
|
+
# (the caller has already moved on).
|
|
56
|
+
if aborted?(event_emitter)
|
|
57
|
+
@consecutive_tool_turns = 0
|
|
58
|
+
return response.content.to_s
|
|
59
|
+
end
|
|
60
|
+
|
|
53
61
|
# Check if there are any tool calls (user-executed or provider-executed)
|
|
54
62
|
has_tool_calls = response.tool_call? || (response.tool_results&.any? == true)
|
|
55
63
|
|
|
@@ -120,6 +128,9 @@ module Ask
|
|
|
120
128
|
|
|
121
129
|
raise MaxTurnsExceeded if @turn_count >= @max_turns
|
|
122
130
|
|
|
131
|
+
# Aborted while tools ran? Skip the follow-up LLM call.
|
|
132
|
+
return response.content.to_s if aborted?(event_emitter)
|
|
133
|
+
|
|
123
134
|
# Recursive call — LLM processes tool results
|
|
124
135
|
run_turn(
|
|
125
136
|
chat: chat,
|
|
@@ -142,6 +153,12 @@ module Ask
|
|
|
142
153
|
|
|
143
154
|
private
|
|
144
155
|
|
|
156
|
+
# Whether the session asked the loop to stop (barge-in). Emitters that
|
|
157
|
+
# don't support aborting (plain stubs) are treated as never aborted.
|
|
158
|
+
def aborted?(event_emitter)
|
|
159
|
+
event_emitter.respond_to?(:abort_requested?) && event_emitter.abort_requested?
|
|
160
|
+
end
|
|
161
|
+
|
|
145
162
|
# Truncate a string for summaries without depending on ActiveSupport's
|
|
146
163
|
# String#truncate (which is not loaded by a bare `require "ask-agent"`).
|
|
147
164
|
def truncate(text, length)
|
data/lib/ask/agent/version.rb
CHANGED