This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Repository navigation
fix(approval): scope pending requests to turn lifecycle #2087
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2073a15
fix(approval): scope pending requests to turn lifecycle
wbxl2000 f1936d5
fix(approval): clean up cancelled approval waiters
wbxl2000 520223d
Merge remote-tracking branch 'origin/main' into approval-lifecycle-cl…
wbxl2000 0aa249d
update: changelog
wbxl2000 e3f16ff
fix(approval): help pyright narrow approval_runtime in nested closures
wbxl2000 7a77603
fix(approval): preserve shared waiters across cancellation
wbxl2000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,7 @@ def create_request( | |
| return request | ||
|
|
||
| async def wait_for_response( | ||
| self, request_id: str, timeout: float = 300.0 | ||
| self, request_id: str, timeout: float | None = None | ||
| ) -> tuple[ApprovalResponseKind, str]: | ||
| waiter = self._waiters.get(request_id) | ||
| request = self._requests.get(request_id) | ||
|
|
@@ -98,7 +98,13 @@ async def wait_for_response( | |
| waiter = asyncio.get_running_loop().create_future() | ||
| self._waiters[request_id] = waiter | ||
| try: | ||
| if timeout is None: | ||
| return await asyncio.shield(waiter) | ||
| return await asyncio.wait_for(asyncio.shield(waiter), timeout=timeout) | ||
| except asyncio.CancelledError: | ||
| if self._waiters.get(request_id) is waiter: | ||
| self._waiters.pop(request_id, None) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| raise | ||
| except TimeoutError: | ||
| logger.warning( | ||
| "Approval request {id} timed out after {t}s", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Unreleasedsection still contains Git conflict markers (<<<<<<<,=======,>>>>>>>) instead of a resolved entry, so this commit publishes raw merge syntax and two competing bullets verbatim. That is user-visible in release notes and can break tooling that parsesCHANGELOG.mdas clean markdown; the same unresolved block is also mirrored intodocs/en/release-notes/changelog.mdanddocs/zh/release-notes/changelog.md.Useful? React with 👍 / 👎.