Skip to content

Feature/handle response#16

Merged
Garulf merged 5 commits into
mainfrom
feature/handle-response
Jun 26, 2026
Merged

Feature/handle response#16
Garulf merged 5 commits into
mainfrom
feature/handle-response

Conversation

@Garulf

@Garulf Garulf commented Jun 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

Garulf added 5 commits June 25, 2026 17:17
Plugin methods can now yield/return Result, List[Result], or use
generators without calling send_results() explicitly. Introduces
types.py to break the result.py→plugin.py circular import, and
response.py with handle_response() applied transparently in the
on_method wrapper. Async generators are handled in EventHandler.
- Extract _collect_item helper to deduplicate Result/list collection in
  both sync generators and async generators
- Fix _await_maybe to handle async functions returning Result or list
  by routing through handle_response-equivalent logic
- Move handle_response wrapping into add_method so on_method returns the
  original unwrapped function (preserving _is_registered_method on it)
- Filter non-Result items from list branches consistently
- Update tests to check event registration by key presence and add
  regression tests for async return, flag preservation, and list filtering
@Garulf Garulf merged commit dc8685e into main Jun 26, 2026
2 of 5 checks passed
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.

1 participant