Skip to content

Feature Request: Option to preserve conversation context when retrying on failure (reset_context: false) #8298

@xtco3o

Description

@xtco3o

Background & Problem

Currently, when a retry operation is triggered (e.g., following a failure in automated checks or system commands), Goose resets the conversation context. While a clean slate can be useful for isolated, independent retries, it is not ideal for iterative problem solving.

When an operation fails—such as a compiler error or failing tests—the error output and the context of the actions that led up to the error are vital for diagnosing the problem. Developers and agents often need to fix these errors sequentially within the same context, rather than having the operation restart from a completely new conversation.

If the conversation context is wiped out during a retry, the agent cannot access the very stdout/stderr it needs to self-correct based on immediate feedback.

Proposed Solution

We propose introducing a reset_context configuration field to the retry and failure logic natively within the agent session. Setting reset_context: false would allow users to specify that the conversation history should be preserved when executing failure handlers or retrying.

When reset_context is configured to false:

  • The session history remains intact.
  • The failure output (like stdout/stderr and exit codes) is gracefully appended to the conversation as an agent-only context/feedback message.
  • The agent can actively analyze the specific feedback, self-correct its earlier output, and attempt the task again iteratively within the exact same session.

This feature enables a much tighter and elegant feedback loop. It empowers the agent for multi-step tasks (e.g., resolving a broken test or fixing a syntax issue that it just introduced) to learn from its immediate mistakes and continue smoothly towards the overarching goal.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions