Skip to content

fix(agy-proxy): flush unterminated tail line before judging no-output on close (#683) - #3173

Merged
dezren39 merged 1 commit into
mainfrom
queue/4595-683-agy-tail-flush
Oct 31, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/4595-683-agy-tail-flush

Conversation

@dezren39

@dezren39 dezren39 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Fixes #683 (triage task 1066 confirmed on main; queue task 4595).

What

AgyWorker's close handler judged a failed turn before ever looking at lineBuffer: a final step_update delta that arrived without a trailing newline was invisible, so _fail set hasOutput=false and the resume-retry gate (allowRetry && resumed && !err.hasOutput) silently retried the turn as a fresh conversation, discarding the partial output.

Tests

  • New stub case FAILTAIL (resumed conversation emits an unterminated partial tail delta, then exits 3) + regression test: non-stream 502 with the stub's stderr, stream delivers the partial tail delta chunk then an error event, never a stop.
  • Regression validity: with the pristine proxy the new test fails (10/11 pass); with this fix the full file passes 11/11 (node --test bin/agy-proxy.test.mjs, run on the laptop with the stub reachable — note the laptop's system agy at /run/current-system/sw/bin/agy shadows the test stub in-place, a pre-existing environment quirk that makes the unmodified suite fail identically on clean main; CI does not have that shadow).

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

… on close (#683)

SessionWorker close path now flushes lineBuffer through the normal line path (_processLine) before _fail, so a final step_update delta without a trailing newline counts as output: the delta is delivered and the resume-retry gate no longer retries a failed resumed turn as a fresh conversation. Adds the FAILTAIL stub case + regression test (fails without the fix, passes with it; full file 11/11 with the stub reachable).
@dezren39
dezren39 requested a review from a team as a code owner October 31, 2026 17:55
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0599a47b-0b92-4af6-b7af-67f2f058da9c
Commits

Reviewing files that changed from the base of the PR and between 4bab46e and 36cf3a5.

Files selected for processing: 2
  • bin/agy-proxy.mjs
  • bin/agy-proxy.test.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T17:56:59.118081Z 36cf3a5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit fc88d0a into main Oct 31, 2026
1 check passed
@dezren39
dezren39 deleted the queue/4595-683-agy-tail-flush branch October 31, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant