feat(plugin): add user function outcome enum - #640
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codex AI reviewOne compatibility issue found. Mixed-version dynamic plugin loading is not covered by the added tests. Reviewed commit |
Claude AI reviewNo actionable findings. The change is correct and well-covered. What I verified
Residual test risk Reviewed commit |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
Closes #636
Description
Replace the boolean user-function completion flag with
UserFunctionOutcome, which hasSUCCEEDED,FAILED, andINCOMPLETEvalues.User functions now report
INCOMPLETEwhen durable execution suspends. Normal returns reportSUCCEEDED, and thrown failures reportFAILED. Deprecated boolean constructor and accessor adapters preserve compatibility for existing plugin implementations.The OTel plugins treat incomplete functions as a neutral outcome: the attempt span remains
UNSET, records theINCOMPLETEattribute, and does not record the internal suspension exception. Conformance handlers and the plugin example now consume the enum directly.Demo/Screenshots
Not applicable. This change updates the Java plugin API and lifecycle event behavior.
Checklist
Testing
mvn clean installResult: 1,803 tests passed with 0 failures and 0 errors. The 31 skipped tests are existing cloud-only example tests.
Unit Tests
Yes. Added converter coverage for all three outcomes and OTel tests that verify incomplete attempts remain neutral and do not record the suspension exception.
Integration Tests
Yes. Updated plugin integration tests to verify successful, failed, retried, and suspended user-function outcomes. Suspension, including a
CompletionException-wrapped suspension, now assertsINCOMPLETEand exposes the unwrapped error.Examples
Updated the existing plugin example to log
outcome. No new example was needed.