Skip to content

Conversation

@Abhijay007
Copy link
Collaborator

Closes: #6140

PR Description

This PR fixes an issue where opening a session from the History tab in read-only mode updated the session’s updated_at timestamp, causing it to move to the top of the history list and break chronological ordering.
The root cause was that resume_agent() was calling update_provider(), which persisted provider data to the database and updated the updated_at timestamp even when the session was only being viewed.

Changes Made

To fix this, a new load_provider() method was introduced to restore the provider state in memory only, without writing to the database or updating timestamps. resume_agent() now uses this method when loading sessions from history.

  • Added load_provider() to restore provider state without persistence
  • Updated resume_agent() to use load_provider() instead of update_provider()

Type of Change

  • Bug fix

AI Assistance

  • This PR was created or reviewed with AI assistance - used Goose to test different approaches for the solution

Testing

Tested in the Desktop UI by opening sessions from the History tab and confirming the session order remains unchanged.

Screenshots / Demos

Before:
beforeHistory

After:

afterHistory

Copilot AI review requested due to automatic review settings December 17, 2025 18:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where viewing a session from the History tab in read-only mode was inadvertently updating the session's updated_at timestamp, causing it to jump to the top of the history list and breaking chronological ordering.

Key Changes:

  • Added a new load_provider() method that restores provider state in memory without database persistence
  • Updated resume_agent() to use load_provider() instead of update_provider() when loading sessions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/goose/src/agents/agent.rs Added load_provider() method that updates provider state in-memory without persisting to database or updating timestamps
crates/goose-server/src/routes/agent.rs Changed resume_agent() to use load_provider() instead of update_provider() to prevent timestamp updates when viewing sessions

let mut current_provider = self.provider.lock().await;
*current_provider = Some(provider.clone());

self.update_router_tool_selector(Some(provider.clone()), None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

odd that this is needed?

Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

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

I think this makes sense, strange needs to set the router tool selector (update it) is main query

@Abhijay007 Abhijay007 merged commit 79ee3c3 into block:main Dec 23, 2025
22 checks passed
wpfleger96 added a commit that referenced this pull request Dec 23, 2025
* main: (155 commits)
  remove Tool Selection Strategy preview (#6250)
  fix(cli): correct bash syntax in terminal integration functions (#6181)
  fix : opening a session to view it modifies session history order in desktop (#6156)
  test: fix recipe and audio tests to avoid side effects (#6231)
  chore: Update gemini versions in test_providers.sh (#6246)
  feat: option to stream json - jsonl really (#6228)
  feat: add mcp app renderer (#6095)
  docs: update skills extension to support .agents/skills directories (#6199)
  Add YouTube short to Chrome DevTools MCP tutorial (#6244)
  docs: Caveats for privacy information in logs documentation (#6218)
  move goose issue solver to opus (#6233)
  feat: improved UX for tool calls via execute_code (#6205)
  Blog: Code Mode Doesn't Replace MCP (#6227)
  fix: prevent keychain requests during cargo test (#6219)
  test: fix test_max_turns_limit slow execution and wrong message type (#6221)
  Skills vs MCP blog (#6220)
  Add blog post: Does Your AI Agent Need a Plan? (#6209)
  fix(ui): enable MCP UI to send a prompt message when an element is clicked (#6207)
  docs: param option for recipe deeplink/open (#6206)
  docs: edit in place or fork session (#6203)
  ...
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.

Desktop: Opening a session to view it modifies session history order

2 participants