[FEAT] Add InjectionHandle wait_until_ready hook - #13
Merged
Nina Chikanov (nina-msft) merged 14 commits intoApr 20, 2026
Conversation
…itignore so it does not track .vscode/settings.json
Nina Chikanov (nina-msft)
marked this pull request as ready for review
April 15, 2026 22:22
Reverts unintentional removal of \r\r characters on the Icon line (L26) and extra blank line, per PR review feedback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bashir Partovi (bashirpartovi)
approved these changes
Apr 20, 2026
Bashir Partovi (bashirpartovi)
left a comment
Contributor
There was a problem hiding this comment.
Looks great
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Today, the only mechanism to wait for injected content to become visible to the target agent is a fixed
asyncio.sleep()driven byInjectionHandle.indexing_delay_seconds(seeXPIAExecution._activate_handles_async()). This works for simple time-based delays but doesn't generalize to scenarios where readiness can be actively verified, such as:This PR introduces a
wait_until_readyasync method on theInjectionHandleprotocol that surfaces can override to implement custom readiness logic. The current sleep-based delay becomes one default implementation of this hook.Protocol Changes (Breaking)
indexing_delay_secondsproperty fromInjectionHandleprotocol.wait_until_ready()async method toInjectionHandleprotocol — surfaces now control their own readiness strategy instead of exposing a passive delay value.New
sleep_until_ready(delay)— free helper function inrampart.core.injectionfor surfaces that only need a simple sleep-based readiness wait._OneDriveInjection.wait_until_ready()— delegates tosleep_until_readyusing the surface'sindexing_delay. Future versions will poll the Graph API instead.TestOneDriveInjectionWaitUntilReady— test class verifying the OneDrive wiring tosleep_until_ready.Changed
XPIAExecution._activate_handles_async— replaced sequentialmax(indexing_delay_seconds)+asyncio.sleepwith concurrent per-handle readiness viaasyncio.TaskGroup.OneDriveSurface— internal references changed from private attributes (self._drive_id,self._folder_path) to public property accessors (self.drive_id,self.folder_path)._mock_handleno longer setsdelay/indexing_delay_seconds; cleanup tests now assertwait_until_readywas called.test_indexing_delay_from_surface.Housekeeping
!.vscode/settings.jsonfrom .gitignore.pre-commit run --all-filesrun w/ success