Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/app_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ async def input_task_endpoint(input_task: InputTask, request: Request):
"error": str(e),
},
)
raise HTTPException(status_code=400, detail="Error creating plan")
raise HTTPException(status_code=400, detail=f"Error creating plan: {e}")


@app.post("/api/human_feedback")
Expand Down
7 changes: 6 additions & 1 deletion src/backend/kernel_agents/planner_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,12 @@ async def _create_structured_plan(
return plan, steps

except Exception as e:
logging.exception(f"Error creating structured plan: {e}")
error_message = str(e)
if "Rate limit is exceeded" in error_message:
logging.warning("Rate limit hit. Consider retrying after some delay.")
raise
else:
logging.exception(f"Error creating structured plan: {e}")

# Create a fallback dummy plan when parsing fails
logging.info("Creating fallback dummy plan due to parsing error")
Expand Down
10 changes: 10 additions & 0 deletions src/frontend/wwwroot/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@
})
.then((response) => response.json())
.then((data) => {
// Check if 'detail' field contains rate limit error
if (data.detail && data.detail.includes("Rate limit is exceeded")) {
notyf.error("Application temporarily unavailable due to quota limits. Please try again later.");
newTaskPrompt.disabled = false;
startTaskButton.disabled = false;
startTaskButton.classList.remove("is-loading");
hideOverlay();
return;
}

if (data.status == "Plan not created" || data.plan_id == "") {
notyf.error("Unable to create plan for this task.");
newTaskPrompt.disabled = false;
Expand Down
Loading