Commit 62094d3
perf/fix: prompt_pipeline lru_cache leak + clear_cache stale; prompt Any hint
prompt_pipeline._build_cached had @lru_cache(maxsize=1) on an instance method
that is called once per fresh PromptPipeline: the cache never helped (new
instance each turn → miss) and (a) leaked the instance via the bound-method
cache and (b) made clear_cache() ineffective (lru_cache returned a stale
string after sections were cleared). Removed the decorator so each build()
rebuilds and clear_cache actually invalidates.
prompt.py: drop a stray `: Any` annotation that referenced an unimported name.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0c6149d commit 62094d3
2 files changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | | - | |
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
| |||
0 commit comments