feat(plugin): report incomplete user function outcomes - #661
Conversation
This comment has been minimized.
This comment has been minimized.
574f651 to
08ac2f9
Compare
This comment has been minimized.
This comment has been minimized.
Removed section on user-function hooks and thread-bound state from README.
Remove unnecessary blank line in README.
| class UserFunctionOutcome(Enum): | ||
| SUCCEEDED = "SUCCEEDED" | ||
| FAILED = "FAILED" | ||
| INCOMPLETE = "INCOMPLETE" |
There was a problem hiding this comment.
Codex AI review
[P1] Version the new lifecycle contract across packages
The plugin API remains v1, so a core-only upgrade still loads existing v1 plugins. Released OTel plugins treat every non-FAILED STEP end as success, causing INCOMPLETE attempts to be exported as successful. Conversely, this PR's OTel package still permits core >=1.8.0, where INCOMPLETE does not exist, so its new enum access raises AttributeError on every STEP end. Increment the core/plugin-provider API version and OTel core dependency floor together, or add a compatibility shim, with mixed-version tests in both directions.
Codex AI reviewOne blocking cross-version compatibility issue remains in the core/OTel plugin lifecycle contract. Reviewed commit |
Summary
UserFunctionOutcome.INCOMPLETEwithout adding a new plugin hook or info typeon_user_function_startis paired with exactly one existingon_user_function_end, including suspension and otherBaseExceptionexitsSemantics
INCOMPLETEmeans the current user-function execution left without producing a success or failure outcome. It covers suspension, orphaned branches, background checkpoint failures, and interpreter-exit control flow. Plugins receive it on the thread that executed the user function, allowing thread-bound state to be released. A suspended operation may resume later and report another start/end pair with its eventual outcome.No new
DurableInstrumentationPlugincallback or payload type is introduced.SUCCEEDEDandFAILEDbehavior is unchanged.Validation
hatch run test:all— 3253 passed, 2 skipped, 5 subtests passedhatch run types:check— cleanhatch run dev-core:typecheck— cleanhatch run dev-otel:typecheck— cleanhatch run dev-otel:test— 146 passedhatch fmt --check— cleanResolves #658