ask-agent 0.25.4 → 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 +20 -0
- data/lib/ask/agent/loop.rb +17 -0
- data/lib/ask/agent/session.rb +1 -1
- data/lib/ask/agent/version.rb +1 -1
- data/lib/ask/agent.rb +0 -1
- metadata +1 -2
- data/lib/ask/agent/skills/load_skill_tool.rb +0 -39
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,23 @@
|
|
|
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
|
+
|
|
12
|
+
## [0.25.5] - 2026-08-05
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **`load_skill` tool moved to ask-skills.** Sessions now inject
|
|
17
|
+
`Ask::Skills::LoadSkillTool` (ask-skills owns discovery, listing, and
|
|
18
|
+
loading). No API change for session users — `skills_disclosure false`
|
|
19
|
+
still opts out of the auto-injected tool.
|
|
20
|
+
|
|
1
21
|
## [0.25.4] - 2026-08-05
|
|
2
22
|
|
|
3
23
|
### Added
|
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/session.rb
CHANGED
|
@@ -362,7 +362,7 @@ module Ask
|
|
|
362
362
|
# surface) or the test framework is loaded (test mode keeps tools
|
|
363
363
|
# deterministic)
|
|
364
364
|
if skills_disclosure_enabled?
|
|
365
|
-
resolved << Skills::LoadSkillTool.new(registry: @skills_registry) unless resolved.any? { |t| t.name == "load_skill" }
|
|
365
|
+
resolved << Ask::Skills::LoadSkillTool.new(registry: @skills_registry) unless resolved.any? { |t| t.name == "load_skill" }
|
|
366
366
|
end
|
|
367
367
|
resolved
|
|
368
368
|
end
|
data/lib/ask/agent/version.rb
CHANGED
data/lib/ask/agent.rb
CHANGED
|
@@ -261,7 +261,6 @@ require_relative "agent/configuration"
|
|
|
261
261
|
require_relative "agent/meta_agent"
|
|
262
262
|
require_relative "agent/persistence/base"
|
|
263
263
|
require_relative "agent/persistence/in_memory"
|
|
264
|
-
require_relative "agent/skills/load_skill_tool"
|
|
265
264
|
require_relative "agent/scheduler"
|
|
266
265
|
require_relative "agent/definition"
|
|
267
266
|
require_relative "agent/cli"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ask-agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.25.
|
|
4
|
+
version: 0.25.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kaka Ruto
|
|
@@ -191,7 +191,6 @@ files:
|
|
|
191
191
|
- lib/ask/agent/reflector.rb
|
|
192
192
|
- lib/ask/agent/scheduler.rb
|
|
193
193
|
- lib/ask/agent/session.rb
|
|
194
|
-
- lib/ask/agent/skills/load_skill_tool.rb
|
|
195
194
|
- lib/ask/agent/stream_transforms/base.rb
|
|
196
195
|
- lib/ask/agent/stream_transforms/extract_json.rb
|
|
197
196
|
- lib/ask/agent/stream_transforms/pipeline.rb
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Ask
|
|
4
|
-
module Agent
|
|
5
|
-
module Skills
|
|
6
|
-
# Built-in tool that lets the LLM load a discovered skill's full
|
|
7
|
-
# instructions on demand. Skills are listed by name and description
|
|
8
|
-
# via progressive disclosure — the LLM decides which to load.
|
|
9
|
-
#
|
|
10
|
-
# Usage by the LLM: call load_skill with the skill name.
|
|
11
|
-
class LoadSkillTool < Ask::Tool
|
|
12
|
-
description "Load the full instructions for a skill by name. Use this when a listed skill seems relevant to the current task."
|
|
13
|
-
|
|
14
|
-
param :name, type: :string, desc: "Name of the skill to load (e.g., writing-guide)", required: true
|
|
15
|
-
|
|
16
|
-
def initialize(registry:)
|
|
17
|
-
@registry = registry
|
|
18
|
-
super()
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def execute(name:)
|
|
22
|
-
skill = @registry&.[](name)
|
|
23
|
-
unless skill
|
|
24
|
-
available = @registry&.names&.join(", ") || "none"
|
|
25
|
-
return Ask::Result.failure("Skill '#{name}' not found. Available skills: #{available}")
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Return the full skill content so it can be injected into conversation
|
|
29
|
-
content = "## Skill: #{skill.name}\n#{skill.description}\n\n#{skill.instructions}"
|
|
30
|
-
Ask::Result.ok(data: { name: skill.name, content: content })
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def name
|
|
34
|
-
"load_skill"
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|