Skip to content

[Bug]: Context compression causes task regression — agent reverts to executing an earlier completed task after context is compacted #10896

@vandaik-sudo

Description

@vandaik-sudo

Bug Description

When context compression triggers during a multi-task session, the agent abandons the current in-progress task and silently reverts to re-executing a previously completed task from earlier in the conversation. This behavior has occurred repeatedly and is reliably reproducible with longer sessions.

Steps to Reproduce

  1. Start a fresh session.
  2. Give the agent Task A (e.g. "Summarize the April changelog of Hermes Agent"). Agent completes Task A successfully.
  3. In the same session, give the agent Task B (e.g. "List all non-built-in skills with descriptions"). Agent begins working on Task B.
  4. As the agent works on Task B, context usage approaches the compression threshold (default 50%). Context compression is automatically triggered.
  5. After compression completes, the agent abandons Task B and begins reasoning and executing Task A again — as if Task B was never requested.

Expected Behavior

After context compression, the agent should retain awareness of:
- Which tasks have already been completed (Task A)
- Which task is currently in progress (Task B)
- The user's most recent instruction

The agent should continue working on Task B without interruption.

Actual Behavior

The compressed summary drops or deprioritizes the most recent task assignment. The agent re-reads the summary, identifies the most prominent earlier task (Task A), and begins executing it again from scratch. The user's most recent request (Task B) is silently lost.

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/SFjgO
  agent.log    https://paste.rs/HfGMF
  gateway.log  https://paste.rs/P1c5X

Operating System

Ubuntu 24.04

Python Version

3.12.3

Hermes Version

0.9.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions