feat(server): default exposeErrorDetails to true outside NODE_ENV=production#735
Merged
Merged
Conversation
3cff53c to
a60aa70
Compare
2 tasks
Merged
This was referenced Apr 21, 2026
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.
Handler throws now emit the actual cause + handler name in dev/test/CI, so matrix runs and local dev stop losing hours on opaque 'encountered an internal error'. Production behavior unchanged — set NODE_ENV=production (or pass
exposeErrorDetails: false) to get the old redacted behavior.What changes
createAdcpServer({ exposeErrorDetails })default:false(always redact).process.env.NODE_ENV !== 'production'(redact only in prod).logger.error('Handler failed', ...)now includeserr.stackandhandlerkey.When
exposeErrorDetailsis on, theSERVICE_UNAVAILABLEmessage text is also upgraded fromTool X encountered an internal errortoTool X handler threw: <cause message>so the failure is readable at the call site — not just in server logs.Why now
Matrix v6/v7 had 20–26
SERVICE_UNAVAILABLErows per run with zero diagnostic. Each one was a handler throw, opaque. Validation default-on (#732) can't help — it only fires when the handler returns successfully. The fix has to be at the catch site.Before (v7)
After
Test plan
returns SERVICE_UNAVAILABLE without leaking internalsupdated to passexposeErrorDetails: falseexplicitly (documents the production-prod path).🤖 Generated with Claude Code