Skip to content

Preserve augmented-assignment results in the workflow sandbox - #2018

Merged
tconley1428 merged 1 commit into
temporalio:mainfrom
JackyHsu-X:fix/sandbox-augmented-assignment
Oct 26, 2026
Merged

tconley1428 merged 1 commit into
temporalio:mainfrom
JackyHsu-X:fix/sandbox-augmented-assignment

Conversation

@JackyHsu-X

Copy link
Copy Markdown
Contributor

What was changed

Preserve the result of augmented assignments in the workflow sandbox. Keep the existing proxy for an object mutated in place; wrap a replacement with the same restrictions and context; return primitive results normally. Old aliases retain their original value.

Why?

#1706 fixed the in-place-operation binder and preserved proxies for mutable objects, but its wrapper discards the operator's return value. In a sandboxed workflow:

path = Path("root")
path /= "child"

path stays at root instead of becoming root/child. Tuple +=/*= and frozenset |= are affected too. This fixes the remaining regression while retaining #1706's mutable-list behavior.

Checklist

  1. Related: fix: preserve restricted proxies after in-place operations #1706. This is a narrow bug fix, with no existing issue to close.

  2. How was this tested:

    • Five new regressions fail against the unmodified production source.
    • poe test tests/worker/workflow_sandbox -n 0 -ra: 35 passed, 1 existing Python-version skip, including a real local Temporal service and Worker.
    • Tests cover replacement objects, mutable proxy identity, primitive returns, old aliases, and retained path restrictions.
    • Changed-file Ruff import/format checks, Pyright, Basedpyright and Mypy pass; poe lint-docs passes.

    Tested on Windows/Python 3.13 using checkout Python sources and the unchanged native bridge from the matching temporalio==1.34.0 wheel. The Rust bridge was not rebuilt; the full repository and other OS/Python matrices were not run.

  3. Any docs updates needed?

    Added changelog/fixed/joining-pathfinder.md. No public API signature changes.

AI assistance

OpenAI Codex assisted with investigation, implementation, regression tests, validation, and this description. Codex performed the technical self-review; no human review is claimed.

Keep restricted replacement objects and mutable proxy identity.

Assisted-by: OpenAI Codex
Signed-off-by: JackyHsu-X <xv1070733106@gmail.com>
@JackyHsu-X
JackyHsu-X requested a review from a team as a code owner October 24, 2026 12:30
@CLAassistant

CLAassistant commented Oct 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tconley1428
tconley1428 merged commit 43d4dd7 into temporalio:main Oct 26, 2026
35 of 36 checks passed
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.

3 participants