OpenHands / OpenHands/OpenHands

[Bug]: New chat retains context/state from the previous conversation

Open
#17,271 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

agent-canvas bug frontend GUI priority:low ready-for-dev
Dominant language
TypeScript
Stars
88.5k
Forks
11.6k
Avg merge
2d 22h
Merged PRs (30d)
189

Description

Operating System

Windows

Installation Method

From source (npm run dev / npm run dev:minimal)

Agent Canvas Version

1.17.0

Bug Description

When starting a new conversation from another conversation/chat, the context-usage button and the usage of that specific conversation is retained in the new conversation.

This could mean that the context-usage or UI related things are not being properly managed.

Steps to Reproduce
  1. From the source, run npm run dev
  2. Open an existing conversation.
  3. Start a new chat using the New Chat button.
  4. Observe the new conversation UI before sending a message.
  5. Notice that the context-usage button/state from the previous conversation is still displayed.
  6. Refresh the page.
  7. Observe the context-usage state again.
Actual Behavior
Image

As you can see the screenshot, the context-usage is shown on a new chat.

Expected Behavior

A newly created conversation should start with conversation-scoped context-usage state reset to its initial state (zero).

The context-usage button/usage from the previous conversation should not be carried over to the new conversation unless that state is intentionally global.

Relevant Logs

Acceptance Criteria
  • A newly created conversation does not display stale context-usage
    state from the previous conversation.
  • Conversation-scoped context usage is reset when starting a new chat.
  • Refreshing the page does not restore stale context-usage state.
  • Existing conversations retain their own context-usage state.
  • No regression to normal context-usage tracking.
Screenshots

No response

Additional Context

Hi there! I'd love to look into this problem and help out here. I have already reproduced the behavior locally and will be glad to contribute my code via a PR, provided that the scope is reasonable. May I take up this task?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with npm run dev or npm run dev:minimal and reproduce the issue through the New Chat button using the listed steps. Trace how context-usage state is initialized and retained when switching conversations, then verify that new chats reset it, refreshes do not restore stale state, and existing conversations keep their own usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.