Skip to content

Commit ed1fd7e

Browse files
Refactor plan approval error handling and clean up commented code in PlanPage
1 parent 3646dc2 commit ed1fd7e

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

src/backend/v3/api/router.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,11 @@ async def plan_approval(human_feedback: messages.PlanApprovalResponse, request:
405405
print("Plan approval processed:", result)
406406

407407
except ValueError as ve:
408-
# print(f"ValueError processing plan approval: {ve}")
409408
logger.error(f"ValueError processing plan approval: {ve}")
410409
await connection_config.send_status_update_async(
411410
{
412411
"type": WebsocketMessageType.ERROR_MESSAGE,
413412
"data": {
414-
# "content": f"Approval failed: {str(ve)}",
415413
"content": "Approval failed due to invalid input.",
416414
"status": "error",
417415
"timestamp": asyncio.get_event_loop().time(),

src/frontend/src/pages/PlanPage.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { APIService } from "../api/apiService";
2222
import { StreamMessage, StreamingPlanUpdate } from "../models";
2323
import { usePlanCancellationAlert } from "../hooks/usePlanCancellationAlert";
2424
import PlanCancellationDialog from "../components/common/PlanCancellationDialog";
25-
import { renderPlanExecutionMessage, renderThinkingState } from '../components/content/streaming/StreamingPlanState';
25+
// import { renderPlanExecutionMessage, renderThinkingState } from '../components/content/streaming/StreamingPlanState';
2626
import "../styles/PlanPage.css"
2727

2828
// Create API service instance
@@ -57,9 +57,6 @@ const PlanPage: React.FC = () => {
5757
const [streamingMessageBuffer, setStreamingMessageBuffer] = useState<string>("");
5858
const [showBufferingText, setShowBufferingText] = useState<boolean>(false);
5959
const [agentMessages, setAgentMessages] = useState<AgentMessageData[]>([]);
60-
// const formatErrorMessage = (content: string): string => {
61-
// return `⚠️ ${content}`;
62-
// };
6360
const formatErrorMessage = useCallback((content: string): string => {
6461
return `⚠️ ${content}`;
6562
}, []);
@@ -541,14 +538,6 @@ const PlanPage: React.FC = () => {
541538
}
542539
}, [networkError]);
543540

544-
// Enable input when clarification message is present
545-
// useEffect(() => {
546-
// if (clarificationMessage) {
547-
// console.log('✅ Clarification message present - enabling input');
548-
// setSubmittingChatDisableInput(false);
549-
// }
550-
// }, [clarificationMessage]);
551-
552541
useEffect(() => {
553542
const handleOffline = () => {
554543
console.log('Network disconnected - stopping all processing');
@@ -599,16 +588,6 @@ const PlanPage: React.FC = () => {
599588
}
600589
if (planResult?.messages) {
601590
setAgentMessages(planResult.messages);
602-
603-
// Check if the last message is a clarification request
604-
// const lastMessage = planResult.messages[planResult.messages.length - 1];
605-
// if (lastMessage?.agent === AgentType.GROUP_CHAT_MANAGER &&
606-
// lastMessage?.agent_type === AgentMessageType.AI_AGENT &&
607-
// lastMessage?.content) {
608-
// // This is likely a clarification request, enable input
609-
// console.log('📝 Found clarification message in loaded plan, enabling input');
610-
// setSubmittingChatDisableInput(false);
611-
// }
612591
}
613592
if (planResult?.mplan) {
614593
setPlanApprovalRequest(planResult.mplan);

0 commit comments

Comments
 (0)