fix(bot): stop stderr output from swallowing PR/MR URLs in bot responses#1710
Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Open
fix(bot): stop stderr output from swallowing PR/MR URLs in bot responses#1710kilo-code-bot[bot] wants to merge 1 commit intomainfrom
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Stderr output (git warnings, npm notices, etc.) was incorrectly setting hasError=true, causing runSessionToCompletion to take the error branch which discarded the completionResult containing the PR/MR URL. Changes: - Track stderr via separate hasStderr flag instead of hasError - Include completionResult in error responses when available - Add hasStderr to RunSessionResult for diagnostics - Add tests for extractTextFromMessage and resolveStreamUrl
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 915,886 tokens |
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.
Summary
runSessionToCompletion(), anyoutputevent withsource: 'stderr'(git warnings, npm deprecation notices, linter messages) sethasError = true, causing the function to return the error-branch response which discarded thecompletionResultcontaining the PR/MR URL. Since nearly every cloud agent session produces some stderr, this effectively broke PR/MR URL relay 100% of the time.hasStderrflag instead ofhasError. ThehasErrorflag is reserved for actual fatal errors (stream failures, session interruptions, WebSocket errors). Additionally, even when a real error occurs, if the assistant produced acompletionResultit is now included in the response so PR/MR URLs are never silently lost.RunSessionResult.hasStderradded for diagnostic observability without affecting error semantics. No callers currently inspecthasError, making this backwards-compatible.Verification
runSessionToCompletion(slack-bot.ts, discord-bot.ts, spawn-cloud-agent-session.ts) — none consumehasError, they only useresponseandsessionId, confirming the behavioral change is safe.extractTextFromMessageandresolveStreamUrlpure helper functions.fix/bot-stderr-swallows-pr-url(PR fix(bot): stop stderr output from swallowing PR/MR URLs in bot responses #1709).Visual Changes
N/A
Reviewer Notes
run-session.tsimplementation (commitdb703d7d, Feb 24 2026), but became a 100% failure around March 23-26 when the cloud agent infrastructure update (ec88afba) and related changes increased the frequency/volume of stderr events during sessions.src/lib/cloud-agent-next/run-session.ts:320-324(stderr handler),src/lib/cloud-agent-next/run-session.ts:373-409(result builder).fix/bot-stderr-swallows-pr-urlcontains the identical fix. Consider merging either PR.