Skip to content

Provider request writer can close the next generation's stdin during delayed cleanup #428

Description

@MoonlightByte

Scope and status

Read-only review of main 12c8ee3. Filing only; no implementation authorized by this report.

Observed reproduction

The production _feed_request helper closes over request_stdin and request_payload, which are rebound each generation. The daemon writer is neither retained nor joined before the next generation starts. Delay the old writer between its failed write and finally-close, terminate its child, then advance to the next generation: the old writer closes the NEW child's stdin.

Controlled real OS-pipe diagnostic against current main:

platform=linux
explicit_attempt_args=False
old_writer_closed_next_stdin=True
next_child_received=0
expected_next_bytes=100
evidence_class=controlled I/O primitive, not live gameplay

Local diagnostic: /mnt/c/agent-room-fleet-kit/local-data/389-closeout/writer_race_probe.py
Command: python3 <(git show origin/main:utils/capture/live_provider_call.py)

Source

Writer launch and cleanup.
Introduced with the threaded repair merged as d3c4cbf; still present at reviewed tip. Distinct from the original communicate(input=...) partial-write defect tracked in #409 / #389 / PR #393.

Impact and repair boundary

A fresh retry can receive no request and fail unnecessarily. This does NOT prove the cause of any previously observed Gemma/OpenAI delay.
Proposed review direction: bind pipe/payload to each attempt; own and drain the writer before reissue; cover thread-start failure and cancellation. Preserve structural recovery and no-abandonment under #193. Do not replace the race with another elapsed-time cap.
Acceptance should cover delayed old-writer cleanup, large requests, early child exit, cancellation and a healthy following generation, then appropriate live-provider regression. No fix made.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions