ask-agent 0.30.0 → 0.30.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58b285b250efd49063ba2fb5c078ea3107d3ebd583ab33b4c92c07084280a242
4
- data.tar.gz: 1d6df4327981ec16e652cedbb864112721db2a6ae1c1c5d7d74ecacfe4a6aa38
3
+ metadata.gz: cf67fcc30605c8d4752a97133a13a7fbe500c32a68c47640552bc30cf6dbea5b
4
+ data.tar.gz: 638931a8c1c2c5ae0ca5535e9e78e9252910106af9134366a455523925b6d895
5
5
  SHA512:
6
- metadata.gz: 1adec012cf31271f1039068e6329c172981d631c221e5d18ce21fe2f19d2449bceac06a4fb4e8845b762c59b263b20ba947cd70463947b389e70f618beda501e
7
- data.tar.gz: 84cdadbbf141991d3c294e06ec9f42e689835407bf3a2577d6ce8a9e173bd3eb21030313e0a59b3663f6718bee88b245deab144aaeda440e443ae176877af4cb
6
+ metadata.gz: 01ca01b502aa5789eef910f50626085bb6675e86dedd435b189b0e928d592ac27c48c145ff5c159580c2a9854528160c86074031dccd971b033b75b6f42bf3fa
7
+ data.tar.gz: 6bf3ebc3428cf64c8a1ee7e958e45c349669e4eaba92a8bc5d90b522f0b9a47d4f3743570db235b8d9b4e526d3ea470eb1a81795acc6492fd67afda4b59d9b70
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [0.30.1] — 2026-08-06
2
+
3
+ ### Fixed
4
+
5
+ - **Framework-injected tools are no longer persisted in session metadata.**
6
+ The built-in `load_skill` tool was saved alongside user tools and could
7
+ not be auto-instantiated on load (`LoadSkillTool` requires a registry), so
8
+ the previous 0.30.0 fix skipped it with a broad rescue. Persisted metadata
9
+ now contains only user-supplied tools (`persisted_tools`); `load_skill` is
10
+ re-added by `resolve_tools` per session with a proper registry.
11
+ - **`Session.load` no longer swallows tool-restore failures silently.** The
12
+ safety net now rescues only `NameError` (renamed/removed classes) and
13
+ `ArgumentError` (constructors with required args), and warns with the
14
+ tool name instead of failing the whole load — genuine tool bugs surface
15
+ instead of disappearing.
16
+
1
17
  ## [0.30.0] — 2026-08-06
2
18
 
3
19
  ### Added
@@ -314,14 +314,16 @@ module Ask
314
314
  session = new(
315
315
  id: data[:id],
316
316
  model: data.dig(:metadata, :model),
317
- # Instantiate saved tool classes defensively: tools that cannot be
318
- # auto-constructed (e.g. the built-in LoadSkillTool, which needs a
319
- # registry) are skippedresolve_tools re-adds them with a proper
320
- # registry. Callers can also pass their own `tools:` after load.
317
+ # Restore saved user tools by class name. Tools that cannot be
318
+ # restored renamed/removed classes (NameError) or constructors
319
+ # with required args (ArgumentError) are skipped with a warning
320
+ # instead of failing the whole load; resolve_tools re-adds the
321
+ # framework-injected load_skill tool with a proper registry.
321
322
  tools: data.dig(:metadata, :tools).to_a.filter_map do |name|
322
323
  begin
323
324
  name.constantize.new
324
- rescue StandardError
325
+ rescue NameError, ArgumentError => e
326
+ warn "[ask-agent] Session.load skipped tool '#{name}': #{e.class}: #{e.message}"
325
327
  nil
326
328
  end
327
329
  end,
@@ -694,6 +696,15 @@ module Ask
694
696
  target.instance_variable_set(:@turn_count, data.dig(:metadata, :turn_count) || 0)
695
697
  end
696
698
 
699
+ # User-supplied tools only. Framework-injected tools (the built-in
700
+ # load_skill tool) are re-created by resolve_tools on every session, so
701
+ # persisting them would leak framework internals into user data — and
702
+ # they cannot be auto-instantiated on load anyway (LoadSkillTool needs
703
+ # a registry).
704
+ def persisted_tools
705
+ @tools.reject { |t| t.is_a?(Ask::Skills::LoadSkillTool) }
706
+ end
707
+
697
708
  def persist!
698
709
  payload = {
699
710
  id: @id,
@@ -707,7 +718,7 @@ module Ask
707
718
  },
708
719
  metadata: {
709
720
  model: @chat.model.respond_to?(:id) ? @chat.model.id : @chat.model,
710
- tools: @tools.map { |t| t.class.name },
721
+ tools: persisted_tools.map { |t| t.class.name },
711
722
  max_turns: @max_turns,
712
723
  turn_count: @turn_count,
713
724
  created_at: @created_at.iso8601,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Agent
5
- VERSION = "0.30.0"
5
+ VERSION = "0.30.1"
6
6
  end
7
7
  end
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.30.0
4
+ version: 0.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto