Commit 590174d
fix(parse): surface :repl/exception! as structured :repl-exception failure
Closes #17. parse-cljs-eval-response was passing shadow's
:repl/exception! sentinel through as a value, producing
{:ok? true :value :repl/exception! :rfp.wire/value-fits? true} —
the same false-trust-signal class as #6, one layer down (#6 was
:value nil; this is :value :<sentinel>). A caller that trusts
:ok? true would treat the sentinel as a value and reason from it.
The sentinel fires when shadow-cljs's printer throws while
serialising the eval result. Most common trigger is forms touching
re-frame.core/dispatch or subscribe — re-frame internal types /
reagent reactions throw inside pr-str. The bug bites the eval-cljs
escape-hatch op specifically, forcing users into the dispatch.sh-only
workflow and losing programmatic re-frame interaction.
Fix: in parse-cljs-eval-response, when the parsed result equals
:repl/exception!, throw structured ex-info {:reason :repl-exception
:raw-response <res> :hint "..."}. eval-op's existing try/catch
surfaces it as {:ok? false :reason :repl-exception ...}.
Hint names workarounds — but only ones that actually work, per the
issue's own evidence (the (do ... :ok) wrap was tested in the issue
report and STILL surfaced :repl/exception!, so we don't suggest it):
- For dispatch flows: scripts/dispatch.sh (routes around the eval
channel via the runtime's wire layer).
- For subscribe reads: deref the underlying ratom rather than the
subscribe ratom directly.
- Notes the more robust wire/return! layer fix as a follow-up.
Adds a :repl-exception row to docs/skill/troubleshooting.md so
agents can translate the new reason.
2 new deftests cover the sentinel detection and the negative case
(a legitimate :ok keyword result still passes through, no
regression).
Out of scope: the deeper wire/return! fix that would pre-stringify
re-frame internal types so shadow's printer never sees them. The
issue itself flags this as the more robust direction; a separate
focused issue would track it. The parse-side detection is the
trust-signal fix that unblocks the eval-cljs escape hatch from
silently lying about success today.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d7650a4 commit 590174d
3 files changed
Lines changed: 52 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
552 | 567 | | |
553 | 568 | | |
554 | 569 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1263 | 1298 | | |
1264 | 1299 | | |
1265 | 1300 | | |
| |||
0 commit comments