diff --git a/src/daemon/spawner.py b/src/daemon/spawner.py index 8c6caf2..cda85ac 100644 --- a/src/daemon/spawner.py +++ b/src/daemon/spawner.py @@ -700,13 +700,15 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_ ) # 续杯 spawn(counter 保持占用,直到 max_retries 或最终完成时 release) + # session 策略:原始是 main session (session_id=None) 时,retry 也用 main session try: await self.spawn_full_agent( agent_id=agent_id, message=message, task_id=task_id, on_complete=on_complete, - reuse_session_id=session_id, + use_main_session=(session_id is None), + reuse_session_id=session_id if session_id else None, task_db_path=db_path, ) except Exception: