Class ActionExecutionResult
-
Method Summary
Modifier and TypeMethodDescriptionstatic ActionExecutionResultChecked target/policy/caller binding of a successful dispatch; null for undeclared actions.Original failure for local diagnostics; its message may contain sensitive policy details.Gets the narration to display to the user.Gets what the action returned, or why it failed, without the narration around it: the text an agent keeps about the action it called.booleanWhether this failed dispatch contains a typed UNAUTHORIZED cause.booleanstatic ActionExecutionResultstatic ActionExecutionResult
-
Method Details
-
success
public static ActionExecutionResult success(Object result, String preNarration, String postNarration) -
success
public static ActionExecutionResult success(Object result, String preNarration, String postNarration, String accessBindingFingerprint) -
error
-
getAccessBindingFingerprint
Checked target/policy/caller binding of a successful dispatch; null for undeclared actions. Not a permit. -
isSuccess
public boolean isSuccess() -
isAuthorizationDenied
public boolean isAuthorizationDenied()Whether this failed dispatch contains a typed UNAUTHORIZED cause. Consumers must terminate the current tool turn without asking the model to invent a replacement result;getNarration()is safe denial text. This is a failure disposition, not an authorization grant or a success. -
getResult
-
getPreNarration
-
getPostNarration
-
getErrorMessage
-
getException
Original failure for local diagnostics; its message may contain sensitive policy details. -
getNarration
Gets the narration to display to the user. Returns postNarration on success, errorMessage on failure. -
getOutcome
Gets what the action returned, or why it failed, without the narration around it: the text an agent keeps about the action it called.On success this is the result's own
toString, or"Action completed."when the result isnull, its text is blank or is the identity textObject.toStringgives it, its class has notoStringof its own, or thattoStringfails. The narration, retrieved context and the owner's state are never used. A result whose own text includes another object's identity text, such as a list of objects without atoString, gives that text as it is. For a SCOP action that has run, it is the action's own post-narration, or"Action completed."without one.On failure it is the reason the narration gives, without its
"Action <name> failed: "prefix, decided in this order:"This action is not authorized."when authorization was denied, that is, when a TnsAISecurityExceptionof typeUNAUTHORIZEDis anywhere in the failure's chain;- a retrieval failure's public reason;
- for an
ActionExecutionException, its own message, which for a failure in the action's body is its root cause's type and message as the executor narrates it, for example"IOException: disk full", or"Failed to execute action: <name>"when any other security exception is in the chain; - for any other exception, its cause's message when it has a cause, and its own message when it has none;
"Action failed."when that reason isnullor blank.
When the reason is the message of a TnsAI exception raised inside an agent context, it ends with that context, such as
[agent=..., session=...], and is that context alone when the exception has no message of its own. A failure made byerror(String, Exception)gives its narration as it is.- Returns:
- the outcome, never
null - Since:
- 0.18.5
-