Commit d6df966
fix(ci): unblock test_beacon_atlas_behavior.py + sqlite3.Row.get() bug
Two related fixes that together unblock Rustchain CI on main (red since 2026-05-04, blocking 7+ paid PRs across multiple authors).
Test fix (tests/test_beacon_atlas_behavior.py):
- Seed 4 test agents (bcn_alice_test, bcn_bob_test, bcn_test_from, bcn_test_to) into relay_agents in setUp so the create_contract route's existence check passes
- Add X-Agent-Key headers to POST /api/contracts and PUT /api/contracts/<id> client calls
- For PUT to 'active' (offered → active), authenticate as to_agent (bcn_bob_test) since recipient-only transition
Production fix (node/beacon_api.py:539):
- contract.get('to_agent', '') would AttributeError on sqlite3.Row (no .get() method) → 500 in update_contract
- Replaced with bracket access using .keys() membership check
Codex consensus reviewed the test patch and validated the diagnosis + safety. Production fix surfaced when applying the test fix locally — 401→201 worked but PUT then 500'd. Both fixes are required.
Verification:
- Full tests/test_beacon_atlas_behavior.py: 15/15 pass locally
- No production behavior change beyond fixing the AttributeError path
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ab8a01f commit d6df966
2 files changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
72 | 87 | | |
73 | 88 | | |
74 | 89 | | |
| |||
95 | 110 | | |
96 | 111 | | |
97 | 112 | | |
98 | | - | |
| 113 | + | |
| 114 | + | |
99 | 115 | | |
100 | 116 | | |
101 | 117 | | |
| |||
118 | 134 | | |
119 | 135 | | |
120 | 136 | | |
121 | | - | |
| 137 | + | |
| 138 | + | |
122 | 139 | | |
123 | 140 | | |
124 | 141 | | |
| |||
249 | 266 | | |
250 | 267 | | |
251 | 268 | | |
252 | | - | |
| 269 | + | |
| 270 | + | |
253 | 271 | | |
254 | 272 | | |
255 | 273 | | |
256 | 274 | | |
257 | 275 | | |
258 | 276 | | |
259 | 277 | | |
260 | | - | |
| 278 | + | |
| 279 | + | |
261 | 280 | | |
262 | 281 | | |
263 | 282 | | |
| |||
0 commit comments