ask-agent 0.29.1 → 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 +4 -4
- data/CHANGELOG.md +49 -0
- data/lib/ask/agent/session.rb +17 -6
- 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: cf67fcc30605c8d4752a97133a13a7fbe500c32a68c47640552bc30cf6dbea5b
|
|
4
|
+
data.tar.gz: 638931a8c1c2c5ae0ca5535e9e78e9252910106af9134366a455523925b6d895
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 01ca01b502aa5789eef910f50626085bb6675e86dedd435b189b0e928d592ac27c48c145ff5c159580c2a9854528160c86074031dccd971b033b75b6f42bf3fa
|
|
7
|
+
data.tar.gz: 6bf3ebc3428cf64c8a1ee7e958e45c349669e4eaba92a8bc5d90b522f0b9a47d4f3743570db235b8d9b4e526d3ea470eb1a81795acc6492fd67afda4b59d9b70
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
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
|
+
|
|
17
|
+
## [0.30.0] — 2026-08-06
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **Session checkpoints: fork, rollback, resume.** Versioned, durable
|
|
22
|
+
checkpoints on any state adapter. Enable with
|
|
23
|
+
`Session.new(state: store, checkpoints: true)` — every turn is snapshotted
|
|
24
|
+
under a sequential key, and the session gains time travel:
|
|
25
|
+
- **`Session#rollback!(seq: / turn:)`** — rewind messages and turn count
|
|
26
|
+
to an earlier checkpoint. Later checkpoints are kept, so the session
|
|
27
|
+
can roll forward again. The legacy blob stays consistent.
|
|
28
|
+
- **`Session#fork(at_seq: / at_turn:)`** — a new session (new id, same
|
|
29
|
+
model/tools) whose history is everything up to that point, backed by
|
|
30
|
+
its own checkpoint chain; continue the branch with `run`.
|
|
31
|
+
- **`Session#checkpoint_history` / `Session#load_checkpoint(seq:)`** —
|
|
32
|
+
inspect the timeline. `Session.load` re-enables checkpointing
|
|
33
|
+
automatically when the stored session has checkpoints.
|
|
34
|
+
- `Ask::Agent::CheckpointStore` — the store itself, usable standalone.
|
|
35
|
+
It needs only the minimal KV contract (`get`/`set`/`delete`), so it
|
|
36
|
+
works with every state provider (SQLite, Redis, Postgres, MySQL) and
|
|
37
|
+
custom adapters — no list primitives required, no provider mandated.
|
|
38
|
+
- `Events::SessionRolledBack` / `Events::SessionForked` fire on rollback
|
|
39
|
+
and fork. `Session#delete` cleans up checkpoint keys too.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- **`Session.load` could not restore sessions saved with tools.** The
|
|
44
|
+
built-in `LoadSkillTool` (auto-added to every session) cannot be
|
|
45
|
+
instantiated without a registry, so any saved session with tools failed
|
|
46
|
+
to load with `ArgumentError: missing keyword: :registry`. Load now
|
|
47
|
+
instantiates saved tool classes defensively — un-instantiable classes are
|
|
48
|
+
skipped and re-added by `resolve_tools` with a proper registry.
|
|
49
|
+
|
|
1
50
|
## [0.29.1] — 2026-08-06
|
|
2
51
|
|
|
3
52
|
### Fixed
|
data/lib/ask/agent/session.rb
CHANGED
|
@@ -314,14 +314,16 @@ module Ask
|
|
|
314
314
|
session = new(
|
|
315
315
|
id: data[:id],
|
|
316
316
|
model: data.dig(:metadata, :model),
|
|
317
|
-
#
|
|
318
|
-
#
|
|
319
|
-
#
|
|
320
|
-
#
|
|
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
|
|
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:
|
|
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,
|
data/lib/ask/agent/version.rb
CHANGED