fix: [AIPLAT-1344]: Surface NG error details in API failures - #841
Merged
thisrohangupta merged 1 commit intoAug 20, 2026
Merged
Conversation
Append details, detailedMessage, and extra responseMessages to the client error so agents see the real cause instead of only Unable to process JSON.
|
|
thisrohangupta
approved these changes
Aug 20, 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.
Description
NG error bodies often put the real cause in
details,detailedMessage, orresponseMessageswhilemessageis only a generic string such asUnable to process JSON. Agents then cannot tell what to fix.This change appends those extra fields onto
HarnessApiError.messagewhen they add new information, de-duplicates repeats, and truncates oversized detail. The same enrichment applies torequestandrequestStream.Verified against QA
POST /ng/api/connectorswith a K8sInheritFromDelegatebody that still carriescredential.spec. NG returns 400; nothing is created.Request
NG response
{ "code": 400, "message": "Unable to process JSON", "details": "No spec should be provided with the inherit from delegate type" }Before
After
correlationId and other envelope fields stay on HarnessApiError and are not copied into message. If responseMessages only repeats message, the string is unchanged.
Type of Change
Checklist
pnpm testpassespnpm typecheckpassespnpm buildpassespnpm standards:checkpasses (architecture guardrails — see [docs/coding-standards.md](docs/coding-standards.md))pnpm docs:checkpasses (if registry/tool counts changed)Coding Standards (registry-driven MCP model)
If this PR adds or changes Harness API coverage:
server.registerTool()calls — only toolset definitions insrc/registry/toolsets/ALL_TOOLSETSandToolsetNameunionoperationPolicyon every new/changed endpointsrc/registry/extractors.ts(no raw passthrough on real endpoints)identifierFieldsandscopedeclared on new resourcesconsole.log()insrc/(stdio JSON-RPC safety)N/A — client error parsing only; no registry/toolset changes.