Skip to content

fix: restore replay compatibility for run context approvals and guardrail execution#2415

Merged
seratch merged 1 commit intomainfrom
fix/temporal-replay-compatibility
Feb 4, 2026
Merged

fix: restore replay compatibility for run context approvals and guardrail execution#2415
seratch merged 1 commit intomainfrom
fix/temporal-replay-compatibility

Conversation

@seratch
Copy link
Member

@seratch seratch commented Feb 4, 2026

This pull request fixes durable-agent regressions introduced by runtime behavior changes in src/agents/run.py and src/agents/run_context.py, while keeping current main-branch intent intact.

  • Updates RunContextWrapper approval storage internals to remain Pydantic-schema-compatible when decoded in durable agent activities, by making _ApprovalRecord a dataclass with explicit serializable fields.
  • Keeps runtime-safe annotation fallbacks for ToolApprovalItem/TResponseInputItem so Temporal’s type-adapter path can resolve types without import-cycle issues.
  • Refactors first-turn parallel input-guardrail/model execution in src/agents/run.py to avoid race-driven FIRST_COMPLETED branching and use a deterministic join path, while preserving existing tripwire persistence behavior.

@seratch seratch added this to the 0.8.x milestone Feb 4, 2026
@github-actions github-actions bot added bug Something isn't working feature:core labels Feb 4, 2026
@seratch seratch merged commit c97c958 into main Feb 4, 2026
10 checks passed
@seratch seratch deleted the fix/temporal-replay-compatibility branch February 4, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant