Repository navigation
Conversation
- 将后台任务运行和结果投递移动到独立 mixin,保持原有入口和行为。 - 避免继续扩展超长的 run_turn 模块;原有后台任务与作用域测试 3 项通过。
- 将 /bg 执行上下文标记为不支持异步投递,复用委派工具的同步回退路径。 - 通过真实委派分发验证结果进入最终回复,且普通聊天的异步能力保持不变。 - 回归测试先复现失败;后台任务、配置作用域及异步投递相关 10 项测试通过。
nateEc
marked this pull request as ready for review
October 19, 2026 02:24
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.
What does this PR do?
A gateway
/bgagent currently returns a detached delegation handle and finishes before its child completes. The synthetic background session has no late-completion route, so the child result is lost.Bind the existing stateless-delivery capability inside the background executor context. The delegation tool uses its existing synchronous fallback and the background task delivers the actual child result. The interactive caller keeps its asynchronous delivery capability.
Related Issue
Fixes #140569
Type of Change
Changes Made
How to Test
Based on main
edab579989a1, tested on macOS with Python 3.11:scripts/run_tests.sh tests/gateway/test_background_command.py tests/gateway/test_multiplex_background_task_scope.py tests/gateway/test_async_delivery_capability.py -q -j 2: 10 passed.python scripts/check: all 12 checks passed.No live Telegram/model request was made; full repository suite not run. No configuration, tool-schema or documentation contract changed.
Checklist
Main compatibility check — 2026-10-23
Validated a temporary local merge of unchanged head
ae82f3002b56with mainfab9b01c915aon macOS/Python 3.11: 10 passed, 0 failed.Command:
HERMES_PYTHON=/Users/nathanshan/anaconda3/bin/python HERMES_TEST_FILE_RETRIES=0 scripts/run_tests.sh tests/gateway/test_background_command.py tests/gateway/test_multiplex_background_task_scope.py tests/gateway/test_async_delivery_capability.py -q -j 2.No merge conflict or required code change was found. Ready for review; upstream Actions still await maintainer approval and have not started jobs. No branch-history rewrite or full-suite claim.