mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(classic): register finish result before task continuation
AgentFinished is caught before execute() registers a result, leaving the finish episode with result=None. The interaction loop sees this as "episode in progress" and reuses the old finish proposal instead of calling the LLM for the new task. Register a success result before continuing so the loop calls propose_action() for the new task. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -754,6 +754,16 @@ async def run_interaction_loop(
|
||||
logger.info("User chose to exit after task completion.")
|
||||
return
|
||||
|
||||
# Close the finish episode so the loop doesn't reuse it.
|
||||
# AgentFinished is caught before execute() can register
|
||||
# a result, leaving result=None — which the loop
|
||||
# interprets as "episode in progress, reuse proposal".
|
||||
from forge.models.action import ActionSuccessResult
|
||||
|
||||
agent.event_history.register_result(
|
||||
ActionSuccessResult(outputs=e.message)
|
||||
)
|
||||
|
||||
# Start new task in same workspace, keeping prior context
|
||||
agent.state.task = next_task
|
||||
|
||||
|
||||
Reference in New Issue
Block a user