Skip to content

fix(runtime): route late writes around closed capture buffers - #130

Open
furgalep wants to merge 1 commit into
dev/tuifrom
fix/runtime-closed-capture-buffer
Open

fix(runtime): route late writes around closed capture buffers#130
furgalep wants to merge 1 commit into
dev/tuifrom
fix/runtime-closed-capture-buffer

Conversation

@furgalep

@furgalep furgalep commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fall back to the original process stream when a task inherits a closed execution-capture buffer
  • cover write, writelines, and flush behavior for stale closed buffers
  • preserve ValueError behavior for buffers that are not actually closed

Why

Background tasks inherit context variables and may outlive the execution capture that installed a StringIO. Late logging or exception reporting then writes to a closed buffer and can mask the original failure. This routes only stale, actually-closed buffers to the process stream.

Verification

  • uv run ruff check src/nooa/runtime/stream_wrappers.py tests/runtime/test_stream_wrappers.py
  • uv run ruff format --check src/nooa/runtime/stream_wrappers.py tests/runtime/test_stream_wrappers.py
  • uv run pytest -q tests/runtime/test_stream_wrappers.py (49 passed)

@furgalep
furgalep force-pushed the fix/runtime-closed-capture-buffer branch from 77e9370 to 5cb918a Compare August 12, 2026 21:11
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
@furgalep
furgalep force-pushed the fix/runtime-closed-capture-buffer branch from 5cb918a to f001236 Compare August 19, 2026 06:31
@furgalep
furgalep changed the base branch from main to dev/tui August 19, 2026 06:32
@furgalep furgalep self-assigned this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant