Skip to content

fix(temporal): remove private _JSONTypeConverterUnhandled from type annotations#193

Closed
anchitrao wants to merge 1 commit intomainfrom
fix/temporal-private-symbol-removed
Closed

fix(temporal): remove private _JSONTypeConverterUnhandled from type annotations#193
anchitrao wants to merge 1 commit intomainfrom
fix/temporal-private-symbol-removed

Conversation

@anchitrao
Copy link
Copy Markdown

@anchitrao anchitrao commented Apr 9, 2026

Summary

  • _JSONTypeConverterUnhandled was removed in temporalio 1.25.0 — it was never part of the public API
  • It was only used in the return type annotation of DateTimeJSONTypeConverter.to_typed_value in two files; the method body already uses the public JSONTypeConverter.Unhandled sentinel
  • Fix: replace Any | None | _JSONTypeConverterUnhandled with Any and remove the import

Root cause

The Dockerfile installs dependencies without a lockfile (uv pip install --system -e .), so it resolved temporalio 1.25.0 at build time. 1.25.0 removed _JSONTypeConverterUnhandled, causing an ImportError at pod startup and /readyz returning 503 indefinitely.

Verified

Built the FIPS production image locally with temporalio 1.25.0 installed — imports succeed and DateTimeJSONTypeConverter loads correctly.

Test plan

  • CI build passes
  • agentex pod starts and /readyz returns 200 on dev cluster after next nightly deploy

Greptile Summary

This PR removes references to _JSONTypeConverterUnhandled, a private temporalio symbol that was removed in v1.25.0, replacing the return type annotation Any | None | _JSONTypeConverterUnhandled with Any in two files. The method bodies already use the public JSONTypeConverter.Unhandled sentinel correctly, so only the annotations needed updating.

Confidence Score: 5/5

Safe to merge — minimal, targeted fix that removes a broken private import without changing runtime behavior.

The change only removes a private symbol from type annotations. The method body already used the correct public API (JSONTypeConverter.Unhandled), so no runtime behavior changes. Both files are updated consistently, and the simplified Any return type is accurate. No new logic, no side effects, no security implications.

No files require special attention.

Vulnerabilities

No security concerns identified.

Important Files Changed

Filename Overview
agentex/src/adapters/temporal/client_factory.py Removes private _JSONTypeConverterUnhandled import and simplifies to_typed_value return type annotation to Any; runtime behavior unchanged.
agentex/src/utils/temporal_client.py Identical fix to client_factory.py — removes private import and simplifies return type annotation; method body already uses public API sentinel.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["DateTimeJSONTypeConverter.to_typed_value(hint, value)"] --> B{hint == datetime.datetime?}
    B -- Yes --> C["datetime.fromisoformat(value)\nreturn datetime object"]
    B -- No --> D["return JSONTypeConverter.Unhandled\n(public sentinel)"]
    D --> E["Temporal SDK detects Unhandled\nand falls back to default converter"]
    C --> F["Caller receives typed datetime"]
Loading

Reviews (2): Last reviewed commit: "fix(temporal): remove private _JSONTypeC..." | Re-trigger Greptile

…nnotations

_JSONTypeConverterUnhandled was removed in temporalio 1.25.0 as it was
never part of the public API. The return type annotation was the only
usage — the method body correctly uses the public JSONTypeConverter.Unhandled
sentinel. Replace the return type with Any.
@anchitrao anchitrao requested a review from a team as a code owner April 9, 2026 02:44
@anchitrao
Copy link
Copy Markdown
Author

Closing — changes should go through the private scaleapi/agentex repo. The fix is included in scaleapi/agentex#326.

@anchitrao anchitrao closed this Apr 9, 2026
@anchitrao anchitrao reopened this Apr 9, 2026
@anchitrao
Copy link
Copy Markdown
Author

Closing — the Dockerfile lockfile fix in scaleapi/agentex#326 pins temporalio to 1.23.0, making this unnecessary for now. Whoever bumps temporalio past 1.25.0 in the lockfile should remove the _JSONTypeConverterUnhandled reference at that point.

@anchitrao anchitrao closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant