Conversation
Greptile SummaryThis PR adds a guard at the end of
Confidence Score: 5/5Safe to merge — the fix correctly surfaces a previously silent failure mode with no impact on the normal append path. The added check fires only after the response loop exits via StopAsyncIteration, at which point no concurrent _body_gen iteration can race against the inflight_inputs read. The chosen exception type is consistent with the other protocol-violation raises already in _run_attempt, and the deliberate decision not to retry this condition was confirmed by the team. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Client (_body_gen)
participant S as Server
participant RL as Response Loop
C->>S: Send batch (inflight_inputs grows)
S-->>RL: AppendAck received
RL->>RL: popleft() from inflight_inputs
RL->>C: yield AppendAck
Note over S,RL: Unexpected stream close scenario
C->>S: Send batch N (inflight_inputs grows)
S-->>RL: Stream closed (StopAsyncIteration)
RL->>RL: break out of while loop
RL->>RL: check: if inflight_inputs (non-empty)
RL-->>C: raise S2ClientError (protocol violation, no retry)
Reviews (2): Last reviewed commit: "initial commit" | Re-trigger Greptile |
|
@greptileai address your comments. pls review again. |
closes #65