fix(bus): wire injection_prompt in async inter-agent result delivery (rr#18)#118
Open
kdramapulse wants to merge 1 commit intoPleasePrompto:mainfrom
Open
fix(bus): wire injection_prompt in async inter-agent result delivery (rr#18)#118kdramapulse wants to merge 1 commit intoPleasePrompto:mainfrom
kdramapulse wants to merge 1 commit intoPleasePrompto:mainfrom
Conversation
…(rr#18) from_interagent_result() never set envelope.prompt, so bus._process() always skipped injection and delivered raw sub-agent text instead of passing it through the calling agent's active CLI session. Fix: add injection_prompt kwarg to from_interagent_result(); callers (telegram/app.py, matrix/bot.py) build the full [ASYNC INTER-AGENT RESPONSE] prompt and pass it in. bus._process() then calls inject_prompt() as intended, resuming the parent session with the result and replacing result_text with the processed response. Also adds 10 regression tests (test_interagent_inject_rr18.py) covering idle delivery, lock-contention queueing (Main busy scenario), no-prompt raw-deliver path, and concurrent multi-task isolation. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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.
Summary
from_interagent_result()inbus/adapters.pynever setenvelope.prompt, sobus._process()always skipped injection and delivered raw sub-agent text directly to the user instead of routing it through the calling agent's active CLI session.injection_promptkeyword argument tofrom_interagent_result(); Telegram and Matrix app handlers now build the full[ASYNC INTER-AGENT RESPONSE ...]prompt and pass it in;bus._process()then callsinject_prompt()as intended, resuming the parent session and replacingresult_textwith the processed response.bus/adapters.py,messenger/telegram/app.py,messenger/matrix/bot.py— no changes to bus lock logic, session management, or other delivery paths.Regression tests (
tests/bus/test_interagent_inject_rr18.py)10 new tests covering all 4 required patterns:
inject_promptcalled once,result_textreplaced by injected responseinject_promptnever called wheninjection_prompt=""All 37 tests (adapter suite + rr#18 suite) pass.
Test plan
uv run --extra test pytest tests/bus/test_adapters.py tests/bus/test_interagent_inject_rr18.py→ 37 passedpipx upgrade ductor+touch ~/.ductor/restart-requestedfrom_task_resultpath unchanged)🤖 Generated with Claude Code