ductor
ductor copied to clipboard
Improve resilience on SIGKILL (auto-retry + user guidance) and quick-command handling
Summary
I observed intermittent unresponsiveness when the Codex subprocess is terminated by SIGKILL (return code -9), and /status can feel blocked in busy chats unless it uses a quick bypass path.
I implemented and validated a local fix. Sharing details here for upstream feedback.
Observed behavior
- System logs sometimes show:
Exec failed ... signal SIGKILL- User-facing impact:
- response stream stops mid-run,
- user often has to resend manually,
/statusresponsiveness in channel/group contexts should remain high.
Local changes
1) SIGKILL-aware recovery (highest priority)
- Detect
SIGKILLvia return code (-signal.SIGKILL). - On first SIGKILL:
- kill active chat process(es),
- reset session,
- auto-retry once.
- If retry also ends with SIGKILL:
- return explicit user guidance:
Execution was interrupted. Please send the same request again.- Add internal recovery markers:
recovery.sigkill ... action=retryrecovery.sigkill ... action=user-retry
2) Operational UX during recovery
- In streaming mode, when retrying recovery, emit a system status message:
Please wait, recovering...
3) Quick command bypass improvement
is_quick_command()now also recognizes bot-mentioned commands:/status@my_bot/model@my_bot ...- This helps keep
/statusresponsive in group/channel usage.
Key patch areas
ductor_bot/orchestrator/flows.pyductor_bot/bot/app.pyductor_bot/bot/middleware.pytests/orchestrator/test_flows.pytests/bot/test_middleware.py
Validation
Executed locally:
ruff format .ruff check .mypy ductor_botpytest tests/orchestrator/test_flows.py tests/bot/test_middleware.py
Result:
-
All lint/type checks passed
-
82 passed
Request
If this direction aligns with project expectations, I can prepare a clean PR with:
- SIGKILL recovery retry path,
- final user guidance after retry failure,
/status@botquick-command behavior tests.
Implemented in v0.4.2. Thanks for the detailed report, @jhste102lab!