Commit 3934502
fix(cues): idempotency_key is a body field on fire, not a header
Caught by CI on PR #33 — test_fire_with_idempotency_key failed because
my SDK was sending the key as ``Idempotency-Key`` header, but the
server's ``FireRequest`` schema (cueapi #683) takes it as a BODY field.
Server-side inconsistency vs the messaging primitive: messages.send
takes ``Idempotency-Key`` as a header (``Header(default=None,
alias="Idempotency-Key")`` in app/routers/messages.py:53), but cues
fire takes it as a body field on FireRequest. Same feature name, two
different transports. Phase 2 spec (#683) chose body for cues; SDK has
to live with it.
Also fixed: ``exit_criteria`` was typed ``Dict[str, Any]`` but the
server's FireRequest schema (cueapi #632) defines it as
``Optional[List[str]]`` — list of required-assertion keys for §14
work-verification-light, max 20 entries. Updated SDK type + docstring
to match.
Inline comment explains the server-side header-vs-body inconsistency
so future SDK refactors don't "simplify" the code by moving it back
to the header (which would silently 400 on the server's
``extra="forbid"``).
Caught at CI not local because integration tests against staging are
the only place server-side idempotency behavior is exercised.
Self-noted: ALWAYS verify server schema before claiming "X is header"
vs "X is body" in SDK ports — same feature can have different
transports across endpoints.
Coordination memo: CTO-SEC-PYTHON-33-TEST-FAIL.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 935080d commit 3934502
1 file changed
Lines changed: 24 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
261 | 269 | | |
262 | 270 | | |
263 | 271 | | |
| |||
269 | 277 | | |
270 | 278 | | |
271 | 279 | | |
| 280 | + | |
272 | 281 | | |
273 | 282 | | |
274 | 283 | | |
| |||
283 | 292 | | |
284 | 293 | | |
285 | 294 | | |
286 | | - | |
287 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
288 | 299 | | |
289 | | - | |
| 300 | + | |
290 | 301 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 302 | + | |
0 commit comments