Commit 4a7a0f8
committed
Fix v0.1.6: get_tool_schemas() must be unconditional
Hermes's MemoryManager captures the schema list at register-time, before
the provider's initialize() runs. Our get_tool_schemas() was gated on
self._initialized, returning [] until init completed. By that point
Hermes had already built _tool_to_provider with zero entries for us,
and every bm_* invocation for the rest of the session returned
'Unknown tool: bm_search' from MemoryManager dispatch.
The asymmetry was the giveaway: prefetch (called per-turn, after init)
worked, but tool calls (registered once at start) didn't. Felix
reported recall injection working alongside 'Unknown tool: bm_search'
on the same conversation.
Schemas are static — return them unconditionally. handle_tool_call()
already gates on _initialized + actor presence and returns a clean
tool_error if the actor isn't ready, so user-visible failure modes
stay clean.
Regression test: test_get_tool_schemas_unconditional asserts a fresh
uninitialized provider exposes all 7 schemas. Locks the bug shut.1 parent c35af32 commit 4a7a0f8
4 files changed
Lines changed: 36 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
795 | | - | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
796 | 800 | | |
797 | 801 | | |
798 | 802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
50 | 67 | | |
51 | 68 | | |
52 | | - | |
| 69 | + | |
| 70 | + | |
53 | 71 | | |
54 | | - | |
55 | 72 | | |
56 | | - | |
57 | | - | |
58 | 73 | | |
59 | 74 | | |
60 | 75 | | |
| |||
0 commit comments