Skip to content

Fix sandboxed datetime decoding with replay compatibility - #2094

Open
VegetarianOrc wants to merge 3 commits into
mainfrom
amazzeo/fix-sandboxed-datetime-decoding
Open

VegetarianOrc wants to merge 3 commits into
mainfrom
amazzeo/fix-sandboxed-datetime-decoding

Conversation

@VegetarianOrc

@VegetarianOrc VegetarianOrc commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

This PR exposes the current workflow's runtime flags as a context variable. That is then used in the default payload converter to detect if it should unwrap a sandboxed datetime type hint to be backward compatible with existing histories.

New activations set a new datetime conversion flag on start to ensure that the first WFT processed enables the flag by default and queries that arrive before the flag would be lazily set by inspection can still succeed. Setting the flag is ignored during replay as normal.

New tests have been added to replay history without the flag set and confirm that signals are dropped as before.

Summary

Fixes #2072.

  • Recognize sandbox proxies around datetime type hints in the default JSON converter, preserving custom-converter precedence and existing sandbox restrictions.
  • Add a private workflow flag context so conversion can use the workflow's replay compatibility policy. Enable corrected decoding by default and record its flag at activation start, including for workflows without typed inputs.
  • Preserve legacy decoding when replaying unflagged histories, including signals that were previously dropped.
  • Add flag, converter, query, and replay coverage, including a checked-in unflagged history and a negative-control workflow that demonstrates nondeterminism if a formerly dropped signal is handled.

Validation

  • poe test -s --maxfail=1: 1,783 passed, 10 skipped.
  • poe lint: passed, including pyright, mypy, basedpyright, formatting, import checks, and docstyle.
  • git diff --check: passed.

@VegetarianOrc
VegetarianOrc force-pushed the amazzeo/fix-sandboxed-datetime-decoding branch from 6f19941 to 9ee09ba Compare November 5, 2026 23:11
@VegetarianOrc
VegetarianOrc marked this pull request as ready for review November 6, 2026 00:08
@VegetarianOrc
VegetarianOrc requested a review from a team as a code owner November 6, 2026 00:08

This branch has not been deployed

No deployments
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.

[Bug] Sandboxed datetime hints can fail decoding and drop signals

1 participant