Repository navigation
Commit b4087c7
committed
fix(mem_reader): pass sources=[] explicitly when creating split chunk items
Dropping the sources kwarg entirely broke the _make_memory_item call-site
contract: callers intercepting the keyword with a strict signature (e.g.
the existing project-id propagation test whose fake requires sources=)
fail, and the broad except in _split_large_memory_item turns the TypeError
into a silent fall-back to the unsplit item, so large items stopped being
chunked at all.
Passing an explicit empty list keeps the #2453 no-duplication behaviour
identical while restoring the stable kwarg contract.
Also drop the vacuous no-parent-sources test case: with an empty parent
sources list the old and new code both produced sources == [], so the
assertion could never distinguish the bug from the fix. The non-vacuous
test_split_chunks_do_not_carry_parent_sources already pins the invariant
with a parent that does carry sources.1 parent a213f5c commit b4087c7
2 files changed
Lines changed: 3 additions & 13 deletions
File tree
- src/memos/mem_reader
- tests/mem_reader
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 112 | | |
124 | 113 | | |
125 | 114 | | |
0 commit comments