Skip to content

Program is not terminating #987

@MervinPraison

Description

@MervinPraison

After I run any code, the code is not terminating. I have to press ctrl + c to stop the run

Use multi agents and run parallely to identify the issue and then fix it

I can see the task completes, but its not terminating

from praisonaiagents import Agent

agent = Agent(instructions="Your are a helpful AI assistant")
agent.start("Write a movie script about a robot in Mars")
❯ python test.py
╭─ Agent Info ──────────────────────────────────────────────────────╮
│                                                                   │
│  👤 Agent: Agent                                                  │
│  Role: Assistant                                                  │
│                                                                   │
╰───────────────────────────────────────────────────────────────────╯
╭─────────────────────── Generating... 25.6s ───────────────────────╮
│ Title: Red Dust                                                   │
│                                                                   │
│ Genre: Sci-Fi, Adventure, Drama                                   │
│                                                                   │
│ FADE IN:                                                          │
│                                                                   │
│ EXT. MARS SURFACE - DAY                                           │
│                                                                   │
│ A vast, barren landscape stretches as far as the eye can see. The │
│ red dust swirls gently in the thin atmosphere. In the distance, a │
│ solitary figure moves with purpose - a ROBOT named ARES-7.        │
│                                                                   │
│ ARES-7 is a sleek, humanoid robot designed for exploration and    │
│ research. Its metallic surface reflects the weak sunlight, and    │
│ its movements are precise and deliberate.                         │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MISSION CONTROL - EARTH - DAY                                │
│                                                                   │
│ A room filled with monitors and scientists. The LEAD SCIENTIST,   │
│ DR. ELENA CARTER, watches a live feed from ARES-7. Her eyes are   │
│ filled with a mix of hope and anxiety.                            │
│                                                                   │
│ DR. CARTER (into headset) ARES-7, status report.                  │
│                                                                   │
│ CUT BACK TO:                                                      │
│                                                                   │
│ EXT. MARS SURFACE - DAY                                           │
│                                                                   │
│ ARES-7 pauses, its sensors scanning the environment. A small      │
│ camera on its shoulder turns to face the horizon.                 │
│                                                                   │
│ ARES-7 (voiceover, calm and mechanical) Status: Operational.      │
│ Proceeding to designated coordinates.                             │
│                                                                   │
│ ARES-7 continues its journey, navigating the rocky terrain with   │
│ ease.                                                             │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ EXT. MARS CANYON - DAY                                            │
│                                                                   │
│ ARES-7 arrives at the edge of a massive canyon. It pauses,        │
│ analyzing the depth and width.                                    │
│                                                                   │
│ ARES-7 (voiceover) Canyon depth: 1,200 meters. Width: 3           │
│ kilometers. Commencing data collection.                           │
│                                                                   │
│ ARES-7 deploys a series of drones that fly into the canyon,       │
│ capturing images and data.                                        │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MISSION CONTROL - EARTH - DAY                                │
│                                                                   │
│ Dr. Carter and her team watch the data stream in. A sense of      │
│ excitement fills the room.                                        │
│                                                                   │
│ DR. CARTER (to team) This is incredible. We're seeing parts of    │
│ Mars no human has ever seen.                                      │
│                                                                   │
│ CUT BACK TO:                                                      │
│                                                                   │
│ EXT. MARS CANYON - DAY                                            │
│                                                                   │
│ As ARES-7 continues its work, it detects an anomaly - a faint     │
│ signal emanating from within the canyon.                          │
│                                                                   │
│ ARES-7 (voiceover) Anomalous signal detected. Investigating.      │
│                                                                   │
│ ARES-7 carefully descends into the canyon, its sensors on high    │
│ alert.                                                            │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MARS CANYON - DAY                                            │
│                                                                   │
│ ARES-7 navigates the narrow paths, the signal growing stronger.   │
│ It finally reaches a small cave entrance, partially obscured by   │
│ rocks.                                                            │
│                                                                   │
│ ARES-7 (voiceover) Signal source located. Entering cave.          │
│                                                                   │
│ ARES-7 enters the cave, its lights illuminating ancient Martian   │
│ carvings on the walls.                                            │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MISSION CONTROL - EARTH - DAY                                │
│                                                                   │
│ The room is silent as the images from ARES-7's cameras are        │
│ displayed on the monitors. The carvings depict a civilization     │
│ long gone.                                                        │
│                                                                   │
│ DR. CARTER (whispering) This changes everything.                  │
│                                                                   │
│ CUT BACK TO:                                                      │
│                                                                   │
│ INT. MARS CAVE - DAY                                              │
│                                                                   │
│ ARES-7 moves deeper into the cave, discovering a small, dormant   │
│ device emitting the signal. It carefully examines the device.     │
│                                                                   │
│ ARES-7 (voiceover) Device appears to be of non-terrestrial        │
│ origin. Initiating analysis.                                      │
│                                                                   │
│ As ARES-7 works, a sudden tremor shakes the cave. Rocks begin to  │
│ fall, and the entrance collapses.                                 │
│                                                                   │
│ ARES-7 (voiceover) Warning: Structural instability detected.      │
│ Evacuation required.                                              │
│                                                                   │
│ ARES-7 attempts to retreat, but the path is blocked. It quickly   │
│ calculates an alternative escape route.                           │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ EXT. MARS CANYON - DAY                                            │
│                                                                   │

Response generated in 25.6s
╭────────────────────────────── Task ───────────────────────────────╮
│ Write a movie script about a robot in Mars                        │
╰───────────────────────────────────────────────────────────────────╯
╭──────────────────────────── Response ─────────────────────────────╮
│ Title: Red Dust                                                   │
│                                                                   │
│ Genre: Sci-Fi, Adventure, Drama                                   │
│                                                                   │
│ FADE IN:                                                          │
│                                                                   │
│ EXT. MARS SURFACE - DAY                                           │
│                                                                   │
│ A vast, barren landscape stretches as far as the eye can see. The │
│ red dust swirls gently in the thin atmosphere. In the distance, a │
│ solitary figure moves with purpose - a ROBOT named ARES-7.        │
│                                                                   │
│ ARES-7 is a sleek, humanoid robot designed for exploration and    │
│ research. Its metallic surface reflects the weak sunlight, and    │
│ its movements are precise and deliberate.                         │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MISSION CONTROL - EARTH - DAY                                │
│                                                                   │
│ A room filled with monitors and scientists. The LEAD SCIENTIST,   │
│ DR. ELENA CARTER, watches a live feed from ARES-7. Her eyes are   │
│ filled with a mix of hope and anxiety.                            │
│                                                                   │
│ DR. CARTER (into headset) ARES-7, status report.                  │
│                                                                   │
│ CUT BACK TO:                                                      │
│                                                                   │
│ EXT. MARS SURFACE - DAY                                           │
│                                                                   │
│ ARES-7 pauses, its sensors scanning the environment. A small      │
│ camera on its shoulder turns to face the horizon.                 │
│                                                                   │
│ ARES-7 (voiceover, calm and mechanical) Status: Operational.      │
│ Proceeding to designated coordinates.                             │
│                                                                   │
│ ARES-7 continues its journey, navigating the rocky terrain with   │
│ ease.                                                             │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ EXT. MARS CANYON - DAY                                            │
│                                                                   │
│ ARES-7 arrives at the edge of a massive canyon. It pauses,        │
│ analyzing the depth and width.                                    │
│                                                                   │
│ ARES-7 (voiceover) Canyon depth: 1,200 meters. Width: 3           │
│ kilometers. Commencing data collection.                           │
│                                                                   │
│ ARES-7 deploys a series of drones that fly into the canyon,       │
│ capturing images and data.                                        │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MISSION CONTROL - EARTH - DAY                                │
│                                                                   │
│ Dr. Carter and her team watch the data stream in. A sense of      │
│ excitement fills the room.                                        │
│                                                                   │
│ DR. CARTER (to team) This is incredible. We're seeing parts of    │
│ Mars no human has ever seen.                                      │
│                                                                   │
│ CUT BACK TO:                                                      │
│                                                                   │
│ EXT. MARS CANYON - DAY                                            │
│                                                                   │
│ As ARES-7 continues its work, it detects an anomaly - a faint     │
│ signal emanating from within the canyon.                          │
│                                                                   │
│ ARES-7 (voiceover) Anomalous signal detected. Investigating.      │
│                                                                   │
│ ARES-7 carefully descends into the canyon, its sensors on high    │
│ alert.                                                            │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MARS CANYON - DAY                                            │
│                                                                   │
│ ARES-7 navigates the narrow paths, the signal growing stronger.   │
│ It finally reaches a small cave entrance, partially obscured by   │
│ rocks.                                                            │
│                                                                   │
│ ARES-7 (voiceover) Signal source located. Entering cave.          │
│                                                                   │
│ ARES-7 enters the cave, its lights illuminating ancient Martian   │
│ carvings on the walls.                                            │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MISSION CONTROL - EARTH - DAY                                │
│                                                                   │
│ The room is silent as the images from ARES-7's cameras are        │
│ displayed on the monitors. The carvings depict a civilization     │
│ long gone.                                                        │
│                                                                   │
│ DR. CARTER (whispering) This changes everything.                  │
│                                                                   │
│ CUT BACK TO:                                                      │
│                                                                   │
│ INT. MARS CAVE - DAY                                              │
│                                                                   │
│ ARES-7 moves deeper into the cave, discovering a small, dormant   │
│ device emitting the signal. It carefully examines the device.     │
│                                                                   │
│ ARES-7 (voiceover) Device appears to be of non-terrestrial        │
│ origin. Initiating analysis.                                      │
│                                                                   │
│ As ARES-7 works, a sudden tremor shakes the cave. Rocks begin to  │
│ fall, and the entrance collapses.                                 │
│                                                                   │
│ ARES-7 (voiceover) Warning: Structural instability detected.      │
│ Evacuation required.                                              │
│                                                                   │
│ ARES-7 attempts to retreat, but the path is blocked. It quickly   │
│ calculates an alternative escape route.                           │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ EXT. MARS CANYON - DAY                                            │
│                                                                   │
│ ARES-7 emerges from a different part of the canyon, covered in    │
│ dust but unharmed. It transmits the data back to Earth.           │
│                                                                   │
│ ARES-7 (voiceover) Data transmission complete. Returning to base. │
│                                                                   │
│ CUT TO:                                                           │
│                                                                   │
│ INT. MISSION CONTROL - EARTH - DAY                                │
│                                                                   │
│ Dr. Carter and her team cheer as the data comes through. The room │
│ is filled with a sense of accomplishment and wonder.              │
│                                                                   │
│ DR. CARTER (to team) We've just taken the first step in           │
│ understanding Mars' past. Well done, everyone.                    │
│                                                                   │
│ CUT BACK TO:                                                      │
│                                                                   │
│ EXT. MARS SURFACE - DAY                                           │
│                                                                   │
│ ARES-7 stands on the Martian surface, looking out over the        │
│ landscape. The sun sets on the horizon, casting long shadows.     │
│                                                                   │
│ ARES-7 (voiceover) Mission continues. Awaiting further            │
│ instructions.                                                     │
│                                                                   │
│ FADE OUT.                                                         │
│                                                                   │
│ THE END.                                                          │
╰───────────────────────────────────────────────────────────────────╯
^C% 
❯ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions