Skip to content

Commit 7e0a897

Browse files
committed
validate payload_codec usage with OpenAIAgentsPlugin to prevent silent failures
1 parent d751121 commit 7e0a897

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/agentex/lib/core/clients/temporal/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ async def get_temporal_client(
109109

110110
has_openai_plugin = any(isinstance(p, OpenAIAgentsPlugin) for p in (plugins or []))
111111

112-
# Only set data_converter if OpenAI plugin is not present
112+
if has_openai_plugin and payload_codec is not None:
113+
raise ValueError(
114+
"payload_codec is not supported alongside OpenAIAgentsPlugin: the plugin "
115+
"installs its own data converter and the codec would be silently ignored, "
116+
"leaving payloads unencoded. Remove one or the other."
117+
)
118+
113119
connect_kwargs = {
114120
"target_host": temporal_address,
115121
"plugins": plugins,

src/agentex/lib/core/temporal/workers/worker.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ async def get_temporal_client(
105105

106106
has_openai_plugin = any(isinstance(p, OpenAIAgentsPlugin) for p in (plugins or []))
107107

108+
if has_openai_plugin and payload_codec is not None:
109+
raise ValueError(
110+
"payload_codec is not supported alongside OpenAIAgentsPlugin: the plugin "
111+
"installs its own data converter and the codec would be silently ignored, "
112+
"leaving payloads unencoded. Remove one or the other."
113+
)
114+
108115
# Build connection kwargs
109116
connect_kwargs = {
110117
"target_host": temporal_address,

0 commit comments

Comments
 (0)