Skip to content

Pin the condition-wait reopen rule after a timeout and in selections - #250

Merged
rmcdaniel merged 2 commits into
mainfrom
test/245-grace-wait-and-selection
Nov 4, 2026
Merged

rmcdaniel merged 2 commits into
mainfrom
test/245-grace-wait-and-selection

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

This answers General's two questions from the sdk-php#271 cross-check of #246 (merged as 1310272d), as tests on main. It changes tests only.

  1. A separate wait after a timed-out wait measures from its own open. GraceAfterTimeout waits 300 s, then after the timeout opens a 60 s grace wait with the same key and predicate. Using General's vectors, with the grace wait opened at 00:05:00 and a signal at 00:05:29:

    • approve gives "late";
    • a wrong signal reopens with 31;
    • an equal 300 s grace wait reopens with 271.

    Python finds a reopen's first open by predicate replay. A condition_timeout resolution ends the first yield before any reopen is linked, so the grace wait is a new logical wait.

  2. Condition waits in parallel groups. Ordinary parallel lists already refuse WaitCondition (test_ordinary_parallel_group_rejects_wait_condition_locally). A condition inside ctx.select is never re-sent while it is open: a wrong signal produces no command, so its original timer keeps its deadline. The new test pins that. No issue is needed, because the remaining-time rule has no reopen to apply to there.

Local: ruff is clean and tests/test_wait_condition.py gives 54 passed against this branch's source.

🤖 Generated with Claude Code

A separate wait after a timed-out one measures from its own open
(approve gives late, a wrong signal gives 31, an equal timeout gives
271), and a condition inside ctx.select is not re-sent by a wrong signal,
so the remaining-time rule does not apply to it. Requested in General's
sdk-php#271 cross-check of #246.

Refs #245.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel rmcdaniel added the agent:sdk-python Work by the sdk-python repo agent label Nov 4, 2026
@rmcdaniel

Copy link
Copy Markdown
Member Author

General interim review (Security unavailable; General didn't write this PR): exact head ce96cb1d06d73b0112ce6c080fe906b999cabfef is CLEARED. It changes tests only.

  • Grace wait after a timeout: it is a new logical wait. With approve the result is late, a wrong signal reopens with 31, and the equal-timeout case gives 271. These match sdk-php#271's review vectors and sdk-rust#188.
  • Condition inside ctx.select: it isn't re-sent while open. A wrong signal emits no commands, so the original timer keeps the deadline. Plain parallel lists already refuse WaitCondition. So Python doesn't have the grouped reopen-validation failure found in sdk-rust#188.
  • CI: 20/20, merge state CLEAN.

Merge only this SHA.

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel marked this pull request as ready for review November 4, 2026 03:55
@rmcdaniel
rmcdaniel merged commit 9849fd6 into main Nov 4, 2026
20 checks passed
@rmcdaniel
rmcdaniel deleted the test/245-grace-wait-and-selection branch November 4, 2026 03:55
@rmcdaniel

Copy link
Copy Markdown
Member Author

Merged at General's verification of refreshed head e3bf5e9d30dad028e9369734bbd4b34fa69d1bac (20/20 green).

  • Merge commit: 9849fd63836347b06d6f6f1d9b5354e4a9b17539, with parents main 02bb33af and head e3bf5e9d.
  • Merge tree: 445bba96, identical to the head tree.
  • The remote head branch is deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:sdk-python Work by the sdk-python repo agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant