Commit b8c1600
fix: drop unhashable Session from lru_cache key (ovos-bus-client 2.x compat) (#60)
* fix: drop unhashable Session from lru_cache key
ovos-bus-client 2.x makes Session unhashable (Session.__hash__ is None),
so passing it as an lru_cache argument to _calc_padacioso_intent raised
TypeError: unhashable type: 'Session' on every match attempt. Pass the two
blacklist sets the matcher actually reads as frozensets (hashable) instead
of the whole Session, restoring caching and matching under bus-client 2.x.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix: invalidate padacioso match cache on register/detach
_calc_padacioso_intent is @lru_cache-keyed on the intent_container object,
which is mutated in place by register/detach. After detaching an intent the
cache returned the stale pre-detach match (no complete_intent_failure emitted),
breaking the detach e2e tests. Clear the cache whenever a container is mutated.
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 8d85875 commit b8c1600
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| 170 | + | |
| 171 | + | |
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
| |||
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
| 211 | + | |
| 212 | + | |
207 | 213 | | |
208 | 214 | | |
209 | 215 | | |
| |||
261 | 267 | | |
262 | 268 | | |
263 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
264 | 274 | | |
265 | 275 | | |
266 | | - | |
| 276 | + | |
| 277 | + | |
267 | 278 | | |
268 | 279 | | |
269 | 280 | | |
| |||
285 | 296 | | |
286 | 297 | | |
287 | 298 | | |
288 | | - | |
| 299 | + | |
| 300 | + | |
289 | 301 | | |
290 | 302 | | |
291 | 303 | | |
| |||
295 | 307 | | |
296 | 308 | | |
297 | 309 | | |
298 | | - | |
299 | | - | |
| 310 | + | |
| 311 | + | |
300 | 312 | | |
301 | 313 | | |
302 | 314 | | |
| |||
0 commit comments