chennaji9 opened a new pull request, #6777: URL: https://github.com/apache/rocketmq-dashboard/pull/6777
### Which Issue(s) This PR Fixes None — small self-contained fix found by inspection (no issue tracked). ### Brief Description `CliAgentProvider.complete()` — the path every completion-style provider (qoder's one-shot runs, the prompt enhancement) goes through — started the child with `redirectErrorStream(true)`, so stderr was merged into stdout and captured as the completion result: - a qoder run that streamed its answer and then printed SDK/connection warnings to stderr returned the warnings appended to (or, with an empty answer, *instead of*) the answer — the merged text is what passed the empty-completion check; - the existing `completeSurvivesLargeStderrOutput` test even asserted this: it checked the result is longer than 500 000 bytes because the stderr noise was in it. That only proved the pipe could not deadlock, not that the answer was the answer. stdout and stderr are now drained on separate background threads (the deadlock rationale that justified the background drain is preserved for both pipes): stdout is the completion, stderr is diagnostics — kept bounded at the same output limit but always drained to the end so a chatty child can never block on a full stderr pipe. A non-zero exit reports stderr first (falling back to stdout when the CLI wrote nothing to stderr). ### How Did You Test This Change? `cd server && mvn -B -ntp test -Dtest='CliAgentProviderTest,ClaudeCodeAgentProviderTest,QoderAgentProviderTest' -DfailIfNoTests=false` → **Tests run: 38, Failures: 0**. - `completeSurvivesLargeStderrOutput` (updated) — 500 KiB of stderr, no deadlock, and the completion is now exactly `DONE`, none of the noise; - `completeRejectsACompletionWhoseStdoutStayedEmptyTest` (new) — warnings on stderr with exit 0 is an `llm.provider.empty_completion`, not a "completion"; - `completeReportsStderrDiagnosticsOnFailureTest` (new) — a failed exit names its stderr in the error. Red side: both new/updated expectations were run against the unfixed `complete()` and fail — the empty-stdout run returns the warning text as the completion, and the 500 KiB of stderr used to be the result. ### Checklist - [x] One coherent change; unrelated modifications are not bundled in - [x] Commit subject follows Conventional Commits (`fix:`) - [x] Tests added or updated for non-trivial changes (2 new tests + 1 assertion-migration, red-green) - [x] New UI text has both Chinese and English entries under `web/src/i18n/` (n/a — no UI change) - [x] Architecture constraints stay green (same class, no new dependency) - [x] New source files carry the ASF license header (n/a — no new source file) - [x] Documentation touched where behaviour changed (n/a — the class contract "captures stdout as the completion result" now actually holds) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
