Skip to content

Compacting context no longer resets the token count #4635

@understood-the-assignment

Description

Describe the bug

A regression in the token counter seems to cause goose to stop resetting the token count when the context is automatically summarized.

In turn, this causes goose to re-summarize the conversation after every interaction.

To Reproduce
Steps to reproduce the behavior:

  1. Run Goose from main (seeing this on 6970cd8)
  2. Have an interaction to build up context
  3. Let the context reach the 30% threshold

Expected behavior
When goose auto-compacts the context, the context token counter should reset, and goose should stop auto-compacting the context after every follow-up prompt.

Screenshots

Context: ●●●○○○○○○○ 34% (67787/200000 tokens)
( O)> When using the [...]

Exceeded auto-compact threshold of 30%. Context has been summarized and reduced.


I understand. I'll make sure to [...]

Is there anything specific you'd like me to help with regarding the [...]
Context: ●●●●○○○○○○ 35% (69847/200000 tokens)
( O)> Previous request was: Update [...]

Exceeded auto-compact threshold of 30%. Context has been summarized and reduced.


[...]
Context: ●●●●○○○○○○ 39% (78233/200000 tokens)

Please provide following information:

  • OS & Arch: NixOS
  • Interface: CLI
  • Version: 6970cd8
  • Extensions enabled: None
  • Provider & Model: N/A

Additional context
It's possible that the token counter is working properly, but goose is actually not actually clearing the context before appending the summary. However, the model does seem to lose context after each summarization, so I suspect it's just that the token counter is broken.

Metadata

Metadata

Assignees

Labels

p2Priority 2 - Medium

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions