fix(plugin): correct replay callbacks and operation span timing - #591
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.
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.
Codex AI reviewNo actionable findings. Residual risk: this was a static review; repository tests were not executed per instructions. Reviewed commit |
Claude AI reviewI reviewed the full diff for PR #591 against the base revision, tracing the changed behavior through Core change (
The non-terminal replay path still fires OTel timing change — switching operation-span start/end to Tests — coverage is adjusted consistently: the deleted No actionable findings. Residual test risk:
Reviewed commit |
Summary
on_operation_startoron_operation_endfor terminal operations encountered during replayon_operation_startfor replayed operations that are still non-terminalRoot cause
PluginExecutor.on_operation_replayunconditionally emittedon_operation_startand then also emittedon_operation_endfor terminal checkpointed operations. That made every plugin responsible for filtering replay history and caused OTel to emit an already-successful submitter again.The executor now returns before dispatching either callback when the replayed operation has reached
SUCCEEDED,FAILED,TIMED_OUT,CANCELLED, orSTOPPED. This aligns the Python plugin lifecycle with the TypeScript behavior.Invocation-view operation spans also reused durable timestamps from prior invocations. They now use the current local time for both start and end so continuation spans do not overlap their invocation parent.
Conformance failures:
Testing
hatch run test:all(3062 passed, 2 skipped, 5 subtests passed)2 passed, 5 subtests passed)7 passed)hatch run dev-otel:test(92 passed)hatch run types:checkhatch fmt --checkfor core and OTel packages