v0.16.2
ductor v0.16.2
Patch release for async inter-agent result delivery and Codex error reporting.
TL;DR
- Async inter-agent responses now route through the parent session — sub-agent results were previously delivered raw to the user instead of being injected back into the calling agent's CLI session. Merged PR #118 by @kdramapulse.
- Codex
turn.failederrors now show the real cause — usage-limit and similar failures no longer get masked by the misleadingthread … not foundstderr artefact. Reported by @Ilinvic in #117. - Cleaner Matrix session-continuation hint — the injected hint sentence had a missing middle clause on Matrix; both transports now share the same prompt builder.
Fixes
Async inter-agent injection (#118)
Merged contributor PR #118 by @kdramapulse.
from_interagent_result() never set envelope.prompt, so bus._process() always skipped injection and delivered the sub-agent text directly to the user instead of resuming the parent session. The adapter now accepts an injection_prompt kwarg; Telegram and Matrix handlers build the full [ASYNC INTER-AGENT RESPONSE …] prompt and pass it in. Includes 10 new regression tests covering idle delivery, lock-contention queueing, raw-deliver fallback, and concurrent multi-task injection.
Internal cleanup on top: extracted build_interagent_injection_prompt() into bus/adapters.py so both transports share one builder, and fixed the Matrix session_hint which previously rendered as "…in session \X`. via `@X `."` (missing middle clause from a copy/paste).
Codex usage-limit errors (#117)
Reported by @Ilinvic.
When the Codex CLI emitted turn.failed (e.g. usage limit reached), ductor showed Detail: … thread <id> not found — a downstream rollout artefact — instead of Codex's actual error message ("You've hit your usage limit. Try again at 6:00 PM.").
Two fixes:
_StreamStatenow captures the most recent in-streamResultEvent(is_error=True)message intolast_error_message, and_codex_final_resultprefers it over stderr. Priority is nowlast_error_message → accumulated_text → stderr_text → "(no output)". Partial assistant output also now beats stderr noise.classify_cli_error's_RATE_PATTERNSextended with"usage limit","upgrade to pro","hit your"so the friendly localized hint fires for Codex's exact wording, not just429/rate limit.
Verification
pytest— 3661 passedruff check .ruff format --checkmypy ductor_bot— clean over 238 source files