fix(acp): surface serve-acp startup failures on stderr instead of silent exit - #407
Open
Million-mo wants to merge 1 commit into
Open
fix(acp): surface serve-acp startup failures on stderr instead of silent exit#407Million-mo wants to merge 1 commit into
Million-mo wants to merge 1 commit into
Conversation
…ent exit serve-acp redirected all logging to the log file and swallowed startup exceptions: serve-loop errors in ACPServer._start_async were never re-raised despite raise_exceptions=True, and the CLI handler exited with a silent typer.Exit(1). A config that passed validation but failed at agent or transport startup therefore exited with code 1 (or 0) and no terminal output. - _start_async now re-raises serve errors when raise_exceptions is set, consistent with BaseServer.start. - serve_acp now prints the exception type/message and the log file path to stderr before exiting with code 1. Adds unit tests for the re-raise/suppress branch and an e2e test asserting the real CLI prints the error on stderr.
|
Model not found: deepseek/deepseek-v4-flash. Did you mean: deepseek-v4-flash, deepseek-v4-flash-vision-exp? |
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.
Problem
wolfharness serve-acpcould exit with no terminal output when startup failed, making server startup failures indistinguishable from success.Root cause (three layers)
serve_acp.pyredirects all logging to the log file viaconfigure_logging(force=True, log_file=...)—basicConfig(force=True)removes the stderr handler, so every subsequentlogger.exceptiononly lands in~/Library/Logs/wolfharness/acp.log.ACPServer._start_asyncswallows serve-loop exceptions (except Exception: self.log.exception(...)) and never re-raises, despite being constructed withraise_exceptions=True(contradictingBaseServer.startsemantics) — serve errors (e.g. port already in use) exited the process with code 0 silently.serve_acp.pycaught the startup error and raisedtyper.Exit(1), which click handles by exiting without printing anything.Reproduced with a config that passes validation but fails at agent construction (
model: nosuchprovider:nonexistent): process exited with code 1, empty stdout and stderr; the traceback existed only in the log file.Fix
ACPServer._start_asyncnow re-raises serve errors whenraise_exceptionsis set, consistent withBaseServer.start— serve failures propagate to the CLI handler instead of dying silently.serve_acpnow prints the exception type/message and the log file path to stderr before exiting with code 1.Tests
_start_asyncre-raises whenraise_exceptions=Trueand swallows-with-log whenFalse.Verification
ACP server failed to start: ValueError: Unknown provider: nosuchprovider+Full traceback in log file: .../acp.log, exit 1.Closes the silent-startup-exit report.