Repository navigation
Run the start_agent test's server outside the suite's process tree - #1928
Draft
realtonyyoung wants to merge 5 commits into
Draft
realtonyyoung wants to merge 5 commits into
realtonyyoung wants to merge 5 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
The server walks its ancestry for coding agents once it finds a hosting variable, so a suite run from an agent made it shed the id under test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dash points an asynchronous list's stdin at /dev/null before its redirections run, so the server read EOF and exited Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shell's stderr is the server's own, and a pid freed by an exited orphan can be reused Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No GitHub or Linear issue
What & why
Start_agent_posts_once_and_returns_without_reading_the_agent_backfailed whenever the suite ran from a coding agent, such as a Claude Code session in the Claude desktop app, while CI passed. The spawnedkcap mcp flowsfindsKCAP_AGENT_IDand walks its ancestry for coding agents. It counts the desktop app and itsclaudeas two, judges itself nested and sheds the id, socaller_agent_idwent out null.The test now starts its server through
/bin/sh, which backgrounds the server and exits. The server is reparented to init, so its ancestry holds none of the suite's processes. The shell hands its pipes down, so the test talks to the server as before, and teardown kills the orphan by the pid the shell printed. On Windows the test spawns directly: Windows doesn't reparent, so the walk stops at the vanished parent anyway. No product code changes.Verification
caller_agent_idemptyMcpFlowsServerTests🤖 Generated with Claude Code