Issue #2790: a catch around h.join() of a handle with a fallback draws a rustc…

Open and answer this issue on GitHub.

ready, bugs · opened 2026-11-23 · updated 2026-12-01 · 3 comments

Filed by the driver from the Found: of the run of issue-989 (#989) (owner, 2026-11-06).

Found

a catch around h.join() of a handle with a fallback draws a rustc refusal instead of taking the failure (D22 step 2, Part I 8.1.2): let h = async(handle) fn { fails(2) } catch { println("fallback"); 7 } then let n = h.join() catch { println(f"join caught {error}"); 9 } in fn main() throws (fails: fn fails(n: i64) -> i64 throws { if n > 1 { throw Bad {} } return n }) gives NK1343 nikaia_std::task::OrCrash<__NikaiaThrows_Bad__io_IoError> doesn’t implement Display; with async(detached) NK1343 __NikaiaThrows_Bad__io_IoError: From<nikaia_std::task::Crashed> not satisfied; should print join caught bad then 9; traced: the fallback is compiled inside the task (emit_core_spawn_fallback, emit_core_flow.nika), so no raw failure reaches the join; needs the decision under Needs

To build

Done when

The probe or check gives the expected output the first item names from its ADR or Part I-III section, and a tests/compiler/tests/ test (or the named check) that failed on the unfixed tree is green; or the probe already passes on develop and a test pins it, naming the commit that fixed it; or the issue is closed as by design, naming the function or ADR.


Generated by Claude Code

Comments

keywan-ghadami, 2026-12-01

Brief queued: issue-2790


agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —

Issue #2790

Your work order is issue #2790, inlined below with its comments. There is no brief written around it: plan your own steps from its To build list, build them in order, commit after each finished step, and end when its Done when holds (or at the limits of builder.md, reporting what is left). The facts in your prompt are Core of docs/builder-facts.md; more on a topic: nikaia run scripts/syntax.nika -- KEYWORD, a probe: nikaia run scripts/probe.nika -- SNIPPET.

Measure the issue against docs/issues.md while you work: what it lacked, what was wrong in it. That answer goes into the report’s Issue: field. A finding, a changed plan or a finished item also goes into the issue as a comment (gh api repos/Nikaia-Foundation/Nikaia/issues/2790/comments -F body=@file, ending with the Claude Code footer), rule I13.

Rules (CLAUDE.md; shared checkout)

Report (at most 15 lines, to exactly /home/user/Nikaia/docs/briefs/bugs/issue-2790.md.report.md)

Fields: Result, Files, Commit, Body (optional), Fixes, Pushed, Tests, Gate, Deviation, Found, Needs, Changelog, Issue, Owner (a question for the owner), Comment (#N <text>, what to say on another issue; the driver posts it, one line each), Friction, Disk freed, and last Attribution: with your commit trailer lines below it.


Generated by Claude Code

keywan-ghadami, 2026-12-01

Run: issue-2790, Result: done

Tokens: input 22, cache read 388874, cache write 30115, output 3689 Cost: 0.43 USD, time 1 min 2 s, turns 11

Report

Result: done Body: the Found’s probe (both async(handle) and async(detached), with impl Error for Bad added, which the Found’s snippet lacked and which NK1161 asks for) prints join caught bad then 9 on develop 2783ab04e; fixed by “async: hold a handle’s failure until its join; the fallback runs there or on detach/drop (ADR-async-v6 D22, D40)” (Fixes #2808), which already pins both shapes as tests/compiler/tests/async_fail_handle_failure_caught_at_join.nika and async_fail_detached_failure_caught_at_join.nika (the Found’s exact probe plus a plain join); no new test, nothing committed Pushed: none Tests: nikaia test –both-settings –project tests/compiler –filter async_fail_ 25 passed, the two pinning tests ok; probe run on target/fast/nikaia built at HEAD 2783ab04e Gate: green Deviation: none Found: none Needs: none Changelog: none Issue: broke I5: the Found’s probe lacks impl Error for Bad, so copied as written it stops at NK1161 and NK1201 before reaching the join; broke I13: the issue was filed after its fix under #2808 had landed with tests that pin the same probe Comment: #2790 Already fixed by the fix for #2808 (commit “async: hold a handle’s failure until its join; the fallback runs there or on detach/drop (ADR-async-v6 D22, D40)”), pinned by tests/compiler/tests/async_fail_handle_failure_caught_at_join and async_fail_detached_failure_caught_at_join; the probe prints join caught bad, 9 on develop 2783ab04e. Can be closed. Friction: scripts/probe.nika –file refuses a scratchpad path (needs a path below the working directory); ran nikaia run from the scratchpad instead Disk freed: none (project-tests cache absent; / 13G free of 252G) Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01UVxJDutPTwP5Xj5HkGuidk

Debrief

  1. Most cost: very little. It took one wasted turn because scripts/probe.nika --file refuses a path in the scratchpad, and one more because the issue’s probe stopped at NK1161 and NK1201 (no impl Error for Bad) before it ever reached the join.
  2. Looked up: which commit fixed the bug and which tests pin it. git log -400 | grep join|fallback led to the fix for #2808, and grepping join() catch in tests/compiler/tests found the two tests. The brief could have said “#2808 landed after this Found was written”.
  3. Checks: the binary-vs-HEAD check, the probe in both forms (handle and detached), and nikaia test --both-settings --filter async_fail_ (25 passed). The test run was mostly redundant, since the driver runs those tests anyway, but it was cheap.
  4. One change: before queueing an issue a Found filed, the driver could run the Found’s probe on the tip and grep tests/compiler/tests for its key line. If it passes and a test pins it, the driver closes the issue with no builder run.
  5. What the issue lacked:
    • broke I5: the probe doesn’t compile as filed, because it lacks impl Error for Bad.
    • broke I13: the issue was filed after the fix for #2808 had landed with tests that pin the same probe.
    • wrong I7: the traced cause (the fallback compiled inside the task) no longer holds. task::Hold now gives the failure to a join under catch.
  6. Fact: Core scripts/probe.nika --file F takes only a path below the working directory, so a scratchpad probe runs as cd $S && /home/user/Nikaia/target/fast/nikaia run F.nika.
    Fact: Probes A probe that throws a struct needs impl Error for X { fn message(ref self) -> String { … } } beside it, or NK1161 and NK1201 stop it before the code under test.
  7. Fact: Lowering and lower-std A handle’s failure is held in task::Hold (task.rs, task/group.rs) until the join; a join under catch takes it via handing().join (checker fact handed_joins), else the fallback runs. Pinned by async_fail_{handle,detached}_failure_caught_at_join (fix for #2808, 2026-11-29, 27aa57817).

Generated by Claude Code

keywan-ghadami, 2026-12-01

From the report of the run of issue-2790 (#2790):

Already fixed by the fix for #2808 (commit “async: hold a handle’s failure until its join; the fallback runs there or on detach/drop (ADR-async-v6 D22, D40)”), pinned by tests/compiler/tests/async_fail_handle_failure_caught_at_join and async_fail_detached_failure_caught_at_join; the probe prints join caught bad, 9 on develop 2783ab04e. Can be closed.


Generated by Claude Code

Back to Open Issues