Commit 86c0622
committed
fix(summarize): address CodeRabbit review on #472
Four nits flagged by the automated reviewer, all worth fixing:
- scripts/backfill: add curl --connect-timeout + --max-time profiles
(META_CURL_OPTS vs WORK_CURL_OPTS). Metadata reads fail fast and
retry on transient blips; LLM-backed work calls get a wide 30-min
cap and no retry (retrying a half-finished LLM job double-spends).
- scripts/backfill: sanitize sessionId before joining with DEBUG_DIR
in dump_failure() (otherwise a session id containing `/` or `..`
could escape the debug dir). UUIDs in practice, but the server
doesn't enforce that.
- scripts/backfill: switch the observations query to
`--get --data-urlencode "sessionId=$id"` so special characters
can't corrupt the query string.
- scripts/backfill: guard `jq` on summarize + consolidate responses
with `jq -e . </dev/null 2>&1` first. iii's HTTP layer occasionally
returns non-JSON (HTML 5xx, empty body on timeout). Without the
guard, `set -e` aborts the whole backfill loop on a single bad
response — now it logs `invalid_json_response` and moves on.
- test/summarize.test.ts: fix `vi.mock("./audit.js", ...)` path to
`"../src/functions/audit.js"`. The old path resolved to
`test/audit.js` (nonexistent), so the mock was a silent no-op.
Tests passed anyway because `safeAudit` writes to a mocked KV.
9/9 tests still pass; backfill dry-run still resolves the corpus
cleanly.1 parent 99cec95 commit 86c0622
2 files changed
Lines changed: 46 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
71 | | - | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
77 | | - | |
| 86 | + | |
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
| |||
148 | 157 | | |
149 | 158 | | |
150 | 159 | | |
151 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
152 | 167 | | |
153 | 168 | | |
154 | 169 | | |
155 | 170 | | |
156 | 171 | | |
157 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
158 | 177 | | |
159 | 178 | | |
160 | 179 | | |
| |||
185 | 204 | | |
186 | 205 | | |
187 | 206 | | |
188 | | - | |
| 207 | + | |
189 | 208 | | |
190 | | - | |
191 | | - | |
192 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
193 | 221 | | |
194 | 222 | | |
195 | 223 | | |
| |||
220 | 248 | | |
221 | 249 | | |
222 | 250 | | |
223 | | - | |
224 | | - | |
225 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments