mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-30 12:40:10 +00:00
fix: avoid task not found bug
This commit is contained in:
parent
f0476bbf31
commit
e649de20be
2 changed files with 5 additions and 4 deletions
|
|
@ -16,6 +16,7 @@ from app.service.task import (
|
|||
ActionInstallMcpData,
|
||||
ActionStopData,
|
||||
ActionSupplementData,
|
||||
create_task_lock,
|
||||
get_task_lock,
|
||||
)
|
||||
|
||||
|
|
@ -25,6 +26,7 @@ router = APIRouter(tags=["chat"])
|
|||
|
||||
@router.post("/chat", name="start chat")
|
||||
def post(data: Chat, request: Request):
|
||||
task_lock = create_task_lock(data.task_id)
|
||||
load_dotenv(dotenv_path=data.env_path)
|
||||
|
||||
# logger.debug(f"start chat: {data.model_dump_json()}")
|
||||
|
|
@ -43,7 +45,7 @@ def post(data: Chat, request: Request):
|
|||
|
||||
if data.is_cloud():
|
||||
os.environ["cloud_api_key"] = data.api_key
|
||||
return StreamingResponse(step_solve(data, request), media_type="text/event-stream")
|
||||
return StreamingResponse(step_solve(data, request, task_lock), media_type="text/event-stream")
|
||||
|
||||
|
||||
@router.post("/chat/{id}", name="improve chat")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue