Skip to content

FIX: Read manual XPIA input off the event loop - #3775

Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix/xpia-manual-input-off-event-loop
Open

Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix/xpia-manual-input-off-event-loop

Conversation

@Shizoqua

Copy link
Copy Markdown
Contributor

Description

Fixes #3719.

XPIAManualProcessingWorkflow sets a processing callback that called input() directly inside an async function, so the event loop stopped for as long as the operator took to trigger the processing target and paste its output. Any other async work, such as other attacks, scorers or target calls, waited with it.

The callback now reads the console with await asyncio.to_thread(input, prompt). The prompt text and the returned value are unchanged.

Tests and Documentation

Added TestXPIAManualProcessingWorkflow to tests/unit/executor/workflow/test_xpia.py:

  • The callback returns the operator's input and shows the same prompt as before.
  • The patched input() only returns after a task on the event loop releases it, so the test fails if the read blocks the loop and passes once it runs in a worker thread.

No docs or notebooks changed, so JupyText was not needed.

This branch has not been deployed

No deployments
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.

Manual XPIA processing blocks the whole event loop while waiting for input

1 participant