Skip to content

fix: the probe tests read the client's initialize before they exit - #737

Merged
tgockel merged 1 commit into
trunkfrom
729-probe-reads-stdin-first
Oct 27, 2026
Merged

tgockel merged 1 commit into
trunkfrom
729-probe-reads-stdin-first

Conversation

@tgockel

@tgockel tgockel commented Oct 27, 2026

Copy link
Copy Markdown
Owner

a_global_images_own_entry_is_not_refused_through_its_stamped_label and its two siblings in the CLI's embedded_image.rs run outrig mcp over a probe, sh -c 'printenv STOLEN >&2', and assert that its stderr, quoted in the startup error, holds the variable. live-e2e failed on them in 5 of the 73 trunk-targeting runs since they landed on Oct 20, and in 4 runs on version/0.3.x, as exit: code 0 beside stderr (...): (empty) (#729).

The probe is an exec-stdio server that writes one line and exits within milliseconds, and podman exec -i can return its exit status without that line. #422 found the same loss under podman start --attach and traced it to the client's initialize message still being unread when the process exits; it restores the text from conmon's log, which an exec session does not have (#727). The probe now reads that line before it prints.

The library's embedded_image.rs has the same probe in probe_label, and launch_resolves_a_label_reference_the_spec_lists asserts on its stderr through McpStartupFailure::stderr_tail. It was not among the failures #729 counted, but it runs the same command through the same exec path, so it reads first too. The other copy of the command there, in a_spec_entry_replaces_the_label_entry_and_is_not_held_itself, only checks which error variant comes back and is left alone.

Reproduced here without outrig: podman exec -i of the old probe with an initialize line already in its stdin pipe and the pipe held open, as rmcp leaves it, 24 at a time pinned to four cores. The old probe lost its stderr in 24 of 400 runs and in 19 of 400 on a repeat, each time with exit status 0, the CI symptom. The probe that reads first lost it in none of 800. Both embedded_image binaries pass locally under --features e2e (15 CLI tests, 13 library tests). What does not follow from this is why the read helps: the effect is measured, and the explanation is #422's applied to exec.

Closes #729

Summary

What does this change, and why?

Checklist

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings is clean
  • cargo test --workspace passes
  • Docs in doc/ updated if behavior changed (mdbook build still clean)
  • CHANGELOG updated for user-visible changes

Notes for reviewers

Anything worth calling out -- tricky bits, follow-ups, or intentionally out-of-scope items.

a_global_images_own_entry_is_not_refused_through_its_stamped_label and
its two siblings in the CLI's embedded_image.rs run `outrig mcp` over a
probe, `sh -c 'printenv STOLEN >&2'`, and assert that its stderr, quoted
in the startup error, holds the variable. live-e2e failed on them in 5
of the 73 trunk-targeting runs since they landed on Oct 20, and in 4
runs on version/0.3.x, as `exit: code 0` beside `stderr (...): (empty)`
(#729).

The probe is an exec-stdio server that writes one line and exits within
milliseconds, and `podman exec -i` can return its exit status without
that line. #422 found the same loss under `podman start --attach` and
traced it to the client's `initialize` message still being unread when
the process exits; it restores the text from conmon's log, which an
exec session does not have (#727). The probe now reads that line before
it prints.

The library's embedded_image.rs has the same probe in `probe_label`,
and launch_resolves_a_label_reference_the_spec_lists asserts on its
stderr through `McpStartupFailure::stderr_tail`. It was not among the
failures #729 counted, but it runs the same command through the same
exec path, so it reads first too. The other copy of the command there,
in a_spec_entry_replaces_the_label_entry_and_is_not_held_itself, only
checks which error variant comes back and is left alone.

Reproduced here without outrig: `podman exec -i` of the old probe with
an `initialize` line already in its stdin pipe and the pipe held open,
as rmcp leaves it, 24 at a time pinned to four cores. The old probe lost
its stderr in 24 of 400 runs and in 19 of 400 on a repeat, each time
with exit status 0, the CI symptom. The probe that reads first lost it
in none of 800. Both embedded_image binaries pass locally under
`--features e2e` (15 CLI tests, 13 library tests). What does not follow
from this is why the read helps: the effect is measured, and the
explanation is #422's applied to exec.

Closes #729
@tgockel
tgockel merged commit 13a44f2 into trunk Oct 27, 2026
11 checks passed
@tgockel
tgockel deleted the 729-probe-reads-stdin-first branch October 27, 2026 18:42
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.

embedded_image probe tests fail intermittently: a probe that exits at once returns an empty stderr through podman exec

1 participant