Fix duplicate task completed panel.
This commit is contained in:
parent
0c6b4f98b3
commit
d7f8a45916
|
|
@ -2,6 +2,7 @@ import argparse
|
|||
import sys
|
||||
from typing import Optional
|
||||
from rich.panel import Panel
|
||||
from rich.markdown import Markdown
|
||||
from rich.console import Console
|
||||
from langchain_core.messages import HumanMessage
|
||||
from langgraph.checkpoint.memory import MemorySaver
|
||||
|
|
@ -149,7 +150,7 @@ def run_agent_with_retry(agent, prompt: str, config: dict) -> Optional[str]:
|
|||
if _global_memory.get('task_completed'):
|
||||
completion_msg = _global_memory.get('completion_message', 'Task was completed successfully.')
|
||||
console.print(Panel(
|
||||
completion_msg,
|
||||
Markdown(completion_msg),
|
||||
title="✅ Task Completed",
|
||||
style="green"
|
||||
))
|
||||
|
|
@ -306,16 +307,8 @@ def main():
|
|||
research_only_note='' if args.research_only else ' Only request implementation if the user explicitly asked for changes to be made.'
|
||||
)
|
||||
|
||||
# Run research agent and check for one-shot completion
|
||||
output = run_agent_with_retry(research_agent, research_prompt, config)
|
||||
if isinstance(output, str) and "one_shot_completed" in str(output):
|
||||
print_stage_header("Task Completed")
|
||||
console.print(Panel(
|
||||
"[green]Task was completed successfully as a one-shot operation.[/green]",
|
||||
title="Task Completed",
|
||||
style="green"
|
||||
))
|
||||
sys.exit(0)
|
||||
# Run research agent
|
||||
run_agent_with_retry(research_agent, research_prompt, config)
|
||||
|
||||
# Run any research subtasks
|
||||
run_research_subtasks(base_task, config, model, expert_enabled=expert_enabled)
|
||||
|
|
|
|||
|
|
@ -317,7 +317,6 @@ def one_shot_completed(message: str) -> str:
|
|||
|
||||
_global_memory['task_completed'] = True
|
||||
_global_memory['completion_message'] = message
|
||||
console.print(Panel(Markdown(message), title="✨ Task Completed", border_style="green"))
|
||||
return message
|
||||
|
||||
def get_related_files() -> Set[str]:
|
||||
|
|
|
|||
Loading…
Reference in New Issue