Skip to content

[Bug]: Skip operation snapshots when no plugins are installed #630

Description

@zhongkechen

Summary

PR #629 adds operation maps to invocation plugin hooks. However, durable_execution() calls the invocation hooks even when no plugins are installed, so PluginExecutor([]) still invokes the operations provider at both invocation start and invocation end.

Each invocation copies the full operation map twice per hook: ExecutionState.operations already returns a copy, and _snapshot_operation_infos() copies it again with dict(...). Users without plugins should not pay this operation-count-dependent cost.

Expected behavior

When the plugin executor has no plugins:

  • Do not retain or invoke the operations provider.
  • Return empty plugin-facing operation maps without snapshotting execution state.
  • Preserve the current snapshot and lazy-conversion behavior when plugins are installed.

Suggested change

Gate provider retention and operation-map snapshotting on self._plugins, returning empty maps when the plugin list is empty.

Acceptance criteria

  • PluginExecutor([]) does not call the operations provider from either the invocation-start or invocation-end hook.
  • Invocation hooks with installed plugins continue to expose the correct operation snapshots.
  • Unit tests cover the empty-plugin case.

Source: #629 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions