Repository navigation
feat(agent): unify tool failure status contract and remove null-status error paths (T38) - #159
Merged
yuluo-yx merged 2 commits intoOct 15, 2026
Conversation
…s error paths (T38)
Contributor
|
hi @konlue 合并了一个比较大的 pr,有些冲突,可以解决下 🌹 |
Conflict resolution notes: - ToolCallResponse: kept main's from(ToolCall, ToolResult) factory and merged the duplicated ERROR_STATUS constant into one declaration with the ToolOutcome javadoc. - AgentToolNode: main's agentic-ai-java#152 refactor removed the ToolExecutionExceptionProcessor path entirely (it was the null-status pseudo-success path T38 targeted); the old sync catch blocks and processedFailureResponse helper were dropped in favour of the new neutral ToolResult error contract. - AgentToolNodeFailureMetadataTest: took main's rewritten CompletionException test (already asserts ERROR_STATUS) and added an async symmetric case for the sync/async consistency acceptance criterion. Full regression after merge: only pre-existing Windows failures remain (FileSystemStoreTest x3, ArgiSkillChatClientTest/SkillPromptTemplateTest x3/ PromptTemplateTest x1 reproduce identically on clean origin/main ee72a72).
Contributor
Author
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.
Describe what this PR does / why we need it
Part 1 of T38 (#141), following the "keep it simple" agreement: unify the tool failure status contract so error exits produce a machine-readable status instead of a status-less response, and define the canonical outcome vocabulary.
Scope note (updated after merging main): the big model-SDK decoupling refactor (#152) landed mid-review and removed the
ToolExecutionExceptionProcessorpath inAgentToolNode— one of the three null-status pseudo-success exits this PR targeted — replacing it with the neutralToolResultcontract that already maps failures to the error status. This PR now covers the remaining ground:ToolOutcome: a constants class defining the canonical outcome vocabulary from the issue (success / error / validation-denied / auth-denied / business-failed / transient / timeout / cancelled / uncertain).SUCCESSandERRORkeep the existing string values; the reserved values are declared now and wired to their producers in the follow-up (PR2: business-failure mapping + model-visible consistency).ToolRetryInterceptor: the exhausted-retries exit returns an explicit error response instead ofof(...).ToolErrorInterceptor: the swallowed-handler-exception exit likewise returns an explicit error response.ToolCallResponse.of()javadoc now documents its status-less historical shape and points new code at the status-carrying factories. TheERROR_STATUSconstant (introduced on main by refactor: decouple ARGI runtime from model SDKs #152 and independently by this branch) is kept as a single declaration.Does this pull request fix one issue?
NONE
Describe how you did it
ToolOutcomeconstants class next toToolCallResponse; the status field stays aString(claim-question 1: starting with the low-invasive option).ToolRetryInterceptor/ToolErrorInterceptornow returnToolCallResponse.error(...)on their failure exits, so those responses carrystatus = "error"plus the standarderror/errorMessagemetadata.Describe how to verify it
AgentToolNodeFailureMetadataTest: sync and async wrapped-exception paths both assertstatus == "error"/isError() == truewith the wrapped exception type in metadata (the async case is new here).ToolRetryInterceptorUnitTest: exhausted-retry response asserts the error status anderror/errorMessagemetadata.New
ToolErrorInterceptorTest(2 cases) covering pass-through and the explicit error shape.Run:
Special notes for reviews
status = "error"(previously null), soisError()flips from false to true there. The retry interceptors only compare againstSUCCESS_STATUS— a null status already counted as non-success — so retry behavior is unchanged.Error:result prefix pluserror/errorMessagemetadata (the formatted message is still in the result).ee72a721c, as do the 3FileSystemStoreTestdrive-root errors).ToolResponseMessagemetadata) stays with the follow-up PR together with the business-outcome mapper.