tractor/ai
Gud Boi a753625fc6 Wait for ctx exit in `maybe_open_context()`
Block the final user on its cached resource's `__aexit__()` and
raise regular cleanup errors at that user's ctx boundary.

Deats,
- serialize user registration and teardown under each cache-key lock
- keep queued entrants on the same lock through resource replacement
- preserve `Cancelled`, `KeyboardInterrupt`, and `SystemExit` flow
- cover successful, failing, cancelled, and re-entry teardown paths

Prompt-IO: ai/prompt-io/opencode/20260804T030309Z_65bf9df5_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-08-03 23:45:42 -04:00
..
conc-anal Bump trio depth=3 cancel timeout 6→12s 2026-06-17 17:39:44 -04:00
prompt-io Wait for ctx exit in `maybe_open_context()` 2026-08-03 23:45:42 -04:00
tooling-todos Add `logspec` leaf-mod Route B follow-up doc 2026-06-17 15:47:07 -04:00