[AAASM-4710] 📝 (python-sdk): README CLI docs + remove dead async callbacks#265
Merged
Merged
Conversation
LangChain dispatches a callback sync-or-async by looking up the on_* name and testing inspect.iscoroutinefunction on it; this handler defines all on_* methods sync, so the async aon_* variants were never reached. The async manager still drives the sync handler. Drop the unused methods (and the now-unused inspect import).
The async suite called the now-removed aon_* methods directly, giving false async coverage. Rewrite it to fire on_tool_start through LangChain's real async callback manager (ahandle_event), which runs the sync handler in an executor — proving governance deny/enforce still blocks across the async dispatch path. Guarded by importorskip on langchain_core.
…li_version_docs # Conflicts: # test/unit/adapters/langchain/test_callback_handler_async.py
|
Contributor
Author
|
Review (AAASM-4710) — READY.
CI: all required checks green. Front-end: no FE/dashboard code touched — Playwright validation N/A. Merge state: BLOCKED only on the required ≥1 Pioneer approval (branch protection), not on any failure. — Reviewed by Claude Code |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.



Description
Three small, hand-verified fixes for AAASM-4710:
aasm --version. The version check was only documented indocs/guides/container-base-image.md. Added a short "confirm theaasmCLI is on your PATH" snippet to the Installation section (aasm --version→aasm 0.0.1rc5).gateway_urltriggers localhost auto-discovery and raisesGatewayErrorafter ~5s. Added a caveat noting the sub-case: whenaasmis not onPATH, discovery can't auto-start a gateway and raisesConfigurationErrorimmediately instead (seegateway_resolver._auto_start_gateway).aon_tool_start/aon_tool_end/aon_llm_start/aon_llm_endmethods were dead: LangChain selects sync-vs-async dispatch by testinginspect.iscoroutinefunctionon the looked-upon_*name, and this handler defines everyon_*sync, so the async manager runs the sync methods in an executor — theaon_*variants were never reached. The async test called those dead methods directly, giving false async coverage. Removed the unused methods (and the now-unusedimport inspect) and rewrote the async test to drive the real async manager viaahandle_event, proving governance deny/enforce still blocks across the async dispatch path.Type of Change
Breaking Changes
The removed
aon_*methods were never reached by LangChain dispatch and had no references outside the async test (confirmed by repo-wide grep), so removing them changes no runtime behavior.Related Issues
Closes AAASM-4710
Testing
Ran the impacted test only (not the full suite):
.venv/bin/python -m pytest test/unit/adapters/langchain/test_callback_handler_async.py -v→ 13 passed (now genuinely exercises the async callback manager viaahandle_event)..venv/bin/python -c "import agent_assembly.adapters.langchain.callback_handler"→ import OK (no breakage after removal)..venv/bin/ruff check+ruff format --checkon both changed files → clean..venv/bin/mypy agent_assembly/adapters/langchain/callback_handler.py→ Success, no issues.Checklist