发射即忘 -- Agent 不会因为命令还在跑就卡住
长时间运行的命令(测试、构建、lint)放入后台执行。Agent 不会卡住等待,可以继续编辑代码、读取文件、做其他工作。
spawn → forget → keep working
后台任务完成后把结果推入通知队列(push model)。Agent 不需要轮询检查任务是否完成,结果会主动送达。
push, not poll = zero waste
每次发起 LLM 调用之前,自动执行 drain_notifications() 清空队列。后台结果作为额外上下文注入到下一次 LLM 调用中。
drain → inject → LLM call
"在后台运行 'sleep 5 && echo done',然后创建一个文件"
"Run 'sleep 5 && echo done' in the background, then create a file while it runs"
"启动 3 个后台任务:'sleep 2'、'sleep 4'、'sleep 6'。检查它们的状态。"
"Start 3 background tasks: 'sleep 2', 'sleep 4', 'sleep 6'. Check their status."
"在后台运行 mvn test,同时做其他事情"
"Run mvn test in the background and keep working on other things"