Skip to content

Conversation

@Jay4242
Copy link
Contributor

@Jay4242 Jay4242 commented Jun 28, 2025

feat(cli): Clear persisted session file with /clear command

The command in the CLI now not only clears the in-memory chat history but also deletes and recreates the associated session file. This ensures that the chat context is fully reset, including any previously persisted messages, providing a more complete clear operation.

Possibly fixes #3138

Screenshot of behavior including the changes within this pull request:
image

Although it should possibly be noted, without these changes the current behavior seems to be that the memory shows as cleared the next time you interact with Goose. The session jsonl file remains until the next interaction with Goose. If the session is /quit immediately after a /clear the session is not cleared.

Example screenshot without the changes in this pull request (existing Goose behavior):
image

Thanks again for your work on this great project!

The  command in the CLI now not only clears the in-memory chat history but also deletes and recreates the associated session file. This ensures that the chat context is fully reset, including any previously persisted messages, providing a more complete clear operation.
Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this and sorry for the delay in responding!

@DOsinga DOsinga merged commit 6f808da into block:main Jul 16, 2025
6 checks passed
lifeizhou-ap added a commit that referenced this pull request Jul 17, 2025
* main:
  feat(gcpvertexai): do HTTP 429 like retries for Anthropic API HTTP 529 overloaded status code (#3026)
  Fix a few ui edge cases - refresh occasionally crashing, chat loader over text and chat input height returning to auto (#3469)
  Don't default to main for build-cli (#3467)
  docs: add MongoDB MCP server tutorial (#2660)
  feat: run sub recipe multiple times in parallel (Experimental feature) (#3274)
  chore(release): release version 1.1.0 (#3465)
  chore: implement streaming for anthropic.rs firstparty provider (#3419)
  Fix regression: add back detail to tool-call banners (#3231)
  Document release process and update some just recipes (#3460)
  feat: add download_cli.ps1 file for windows (#3354)
  fix: session_file is optional (#3462)
  Bump more space for goose is working on it so it doesnt overlap incoming agent chat messages (#3453)
  Align chat input action buttons to bottom when large amount of text (#3455)
  docs: add Cloudflare MCP Server tutorial (#3278)
  feat(cli): Clear persisted session file with /clear command (#3145)
s-soroosh pushed a commit to s-soroosh/goose that referenced this pull request Jul 18, 2025
kwsantiago pushed a commit to kwsantiago/goose that referenced this pull request Jul 19, 2025
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
atarantino pushed a commit to atarantino/goose that referenced this pull request Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/clear does not clear context

2 participants