Skip to content

fix(bin): keep failed or non-schema remote reply reads out of captures - #7874

Merged
kunchenguid merged 3 commits into
kunchenguid:mainfrom
mehulbhagwani:fm/fm-remote-reply-transport-fix
Oct 29, 2026
Merged

kunchenguid merged 3 commits into
kunchenguid:mainfrom
mehulbhagwani:fm/fm-remote-reply-transport-fix

Conversation

@mehulbhagwani

@mehulbhagwani mehulbhagwani commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Fix #7874 (branch fm/fm-remote-reply-transport-fix): the 06:15Z body edit replaced the no-mistakes Pipeline section, so the 'PR must be raised via no-mistakes' check fails. Restore the pipeline section by re-raising through no-mistakes at the current head (no hand-edited attestation).

The PR being re-raised is "fix(bin): keep failed or non-schema remote reply reads out of captures", the straight safety fix for #7857, split from the mixed scope in #7860. A failed SSH read or non-schema remote output must not become a malformed captured message. The adapter now emits no output for those cases, so the cursor does not advance and the source remains available for liveness recovery. Genuine continuity-break escalation is unchanged. The regression tests cover Windows-shaped timeout diagnostics and SSH exit 255. Failed-read retry timing is unchanged here; the relisten behavior requested in #5941 is intentionally excluded and will be proposed separately. Fixes #7857. Refs #7860.

What Changed

  • Stage and validate remote delta output before capture, discarding failed or non-schema responses without advancing the cursor.
  • Add regression coverage for Windows-shaped timeout diagnostics and SSH exit 255.
  • Document the remote reply discard and retry behavior.

Risk Assessment

✅ Low: The change is narrowly scoped to filtering failed or malformed remote reads before capture, with behavioral regression coverage and no identified source defects.

Testing

Verified against the real adapter that Windows-shaped transport diagnostics and SSH exit 255 return nonzero, emit no captured output, and leave the cursor untouched; the broader regression script later timed out during an unrelated subsequent scenario.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Windows-shaped timeout diagnostics are not captured as a remote reply ✅ pass live Live remote reply transport validation
SSH exit 255 produces no malformed capture and does not advance the cursor ✅ pass live Live remote reply transport validation
Evidence: Live remote reply transport validation

Source: Live remote reply transport validation

case=windows rc=255 output_bytes=0 output=''
case=ssh255 rc=255 output_bytes=0 output=''
cursor_files=

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Windows-shaped timeout diagnostics are not captured as a remote reply ✅ pass live Live remote reply transport validation
SSH exit 255 produces no malformed capture and does not advance the cursor ✅ pass live Live remote reply transport validation
  • bash tests/fm-remote-reply.test.sh (targeted regression run; reached the transport and capture scenarios before timing out later)
  • Live disposable-fixture invocations of bin/fm-procevent-remote-reply.sh source ios with Windows-shaped diagnostics and SSH exit 255
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking temporary-file cleanup issue.

Reviews (2) · Last reviewed commit: "no-mistakes(document): Document remote r..." · Reviewed by Greptile

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @mehulbhagwani, and thanks for doing the split so quickly.

I read this against main 7da4c362. cmd_source now stages the remote read in a private temp file. It hands the output to the runner only when the read exits 0 and the output classifies as schema. A failed SSH leg, or Windows/WSL diagnostic bytes, now gives the runner a plain no-result, so no malformed capture wedges the source and the cursor stays put. The window-closed-empty and preempted paths are unchanged. Nothing here touches the #5941 "failed read exits instead of relistening" behavior, so this is the straight fix for #7857 on its own. Your live runner transcripts (the base repro, then the fix with recovery and continuity-break escalation) cover what I'd want to see.

contract-class: restore. A failed transport leg must not leave a capture that stops the listener. VISION: aligns. It lets the fleet survive another failure mode, the change is a small script fix with no new surface, and it adds regression coverage.

About #7860: this PR supersedes the wedge-fix half there. The relisten-on-failed-transport half is still a separate decision for Kun.

CI is still running on 32d6e444. The one red job so far is serial 2's fm-watch-triage "paused phase-A stop" acknowledgement, a known flake that this diff doesn't touch. I'll rerun it on our side once the run finishes. If the rest comes back green, this can merge automatically. You don't need to do anything right now. The no-mistakes review's optional notes (an EXIT trap for the temp file, and a rc-0 non-schema test case) are nice-to-haves and don't block this.

@mehulbhagwani

Copy link
Copy Markdown
Contributor Author

The two portable serial failures are unrelated watcher-suite failures. Focused reproductions failed the same way on this PR head and on the base branch. Please rerun the two failed jobs when available.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks for the update, @mehulbhagwani. You're right about the two serial reds. That run (40593122233) was built on the old main 7da4c362, before the watcher suite was reshuffled in #7838 (now 2ba4c455). The serial 1 "latch" and serial 2 "paused phase-A stop" failures are in tests this diff doesn't touch. They're not counted against you, and getting a fresh run on current main is our job. One correction: nobody approved an exception on our side. It's just that stale-base reds don't block a restore.

One thing is waiting on you, though: the body edit at 06:15Z replaced the no-mistakes ## Pipeline section, so PR must be raised via no-mistakes now fails (run 40642746318). The original body's run had passed (40593122343). Could you either put the generated ## Pipeline section back exactly as no-mistakes wrote it, or re-raise with git push no-mistakes? A re-raise also pushes a fresh head, so CI reruns on current main on its own. Feel free to keep your scope and validation notes above the Pipeline section.

Nothing else has changed since my last read. Head is still 32d6e444, contract-class: restore (a failed or non-schema remote read no longer becomes a capture that wedges the source), and VISION: aligns. Once the attestation binds again and CI is green on current main, this takes the restore auto-merge path.