Commit b461c95
Codec: harden _fetch_manifest against non-dict JSON payloads
Address the remaining open bot comment on this PR (the four others
are covered by 2758102 — async dispatch + cached registry +
hardened varint + struct unpack).
If a manifest URL returns a JSON list, scalar, or null, the existing
`if required not in parsed` check raises TypeError with an unhelpful
message. Reject non-dict shapes up front with a clear ValueError that
names the URL and actual type.
Also document why `_fetch_manifest` stays synchronous: it's only
called from `ToolRegistry.from_env`, which the engine wraps in
`asyncio.to_thread`, so the blocking urlopen never runs on the
request event loop.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: William Dunn <wdunn001@gmail.com>1 parent 77467e1 commit b461c95
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
179 | 185 | | |
180 | 186 | | |
181 | 187 | | |
182 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
183 | 195 | | |
184 | 196 | | |
185 | 197 | | |
| |||
0 commit comments