Skip to content

Comments

fix: correct context loading from session new/overwrite and resume#180

Merged
lamchau merged 6 commits intoblock:mainfrom
lamchau:lam/fix-session-overwrite
Oct 24, 2024
Merged

fix: correct context loading from session new/overwrite and resume#180
lamchau merged 6 commits intoblock:mainfrom
lamchau:lam/fix-session-overwrite

Conversation

@lamchau
Copy link
Contributor

@lamchau lamchau commented Oct 22, 2024

This fix corrects session handling with the overwrite session prompt.

Previously overwriting a session didn't

  1. clear the context (which we load at init) https://github.com/block-open-source/goose/blob/7749b8aaf4390a83068045dd98f63345ed9566d9/src/goose/cli/session.py#L95
  2. clear the session file when we write immediately (feat: auto save sessions before next user input #94)
  3. missing test case when adding guards (feat: add guards to session management #101)
  4. edge case when resuming a session (fix: session resume with arg handled incorrectly #145)

Steps to reproduce

$ uv run goose session start aaaa
PLEASE NOTE: the ollama provider is experimental, use with care
Session already exists at /Users/lam/.config/goose/sessions/aaaa.jsonl.
Would you like to overwrite it?

  [y]es      Overwrite the existing session
  [n]o       Pick a new session name
  [r]esume   Resume the existing session

Enter your choice: y
Overwriting existing session
session size: 4

The expected session size should be 0 (or empty).

@lamchau lamchau force-pushed the lam/fix-session-overwrite branch from ab6342a to 237912c Compare October 22, 2024 09:40
@lamchau lamchau requested a review from baxen October 22, 2024 19:41
@lamchau lamchau merged commit 2f33514 into block:main Oct 24, 2024
@lamchau lamchau deleted the lam/fix-session-overwrite branch October 24, 2024 11:13
salman1993 added a commit that referenced this pull request Oct 24, 2024
…rypoint-refactor

* origin/main:
  feat: support optional params jsonschema conversion in exchange (#188)
  fix: correct context loading from session new/overwrite and resume (#180)
  feat: trying a license checker (#184)
  docs: getting index.md in sync with readme (#183)
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 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.

2 participants