Skip to content

Add /clear command to reset current tab with a new session#2199

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/fix-docker-agent-issue-2198-22e5b006
Mar 20, 2026
Merged

Add /clear command to reset current tab with a new session#2199
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/fix-docker-agent-issue-2198-22e5b006

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Mar 20, 2026

Fixes #2198

Introduces a /clear slash command that resets the current tab and starts a fresh session in the same working directory. Unlike /new which opens a new tab, /clear reuses the current tab by creating a new session in-place, rebuilding UI components, and updating persisted state.

Introduces a /clear slash command that resets the current tab and starts
a fresh session in the same working directory. Unlike /new which opens a
new tab, /clear reuses the current tab by creating a new session in-place,
rebuilding UI components, and updating persisted state.

Assisted-By: docker-agent
@dgageot dgageot requested a review from a team as a code owner March 20, 2026 17:50
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

This PR successfully implements the /clear command to reset the current tab with a new session. The implementation properly:

  • Cleans up the old editor before creating a new one
  • Creates a fresh session while preserving the working directory
  • Rebuilds all UI components (chat page, editor, session state)
  • Updates persisted state to point to the new session ID
  • Handles errors from persistence operations with appropriate logging

All hypotheses about potential resource leaks, unchecked errors, and race conditions were investigated and dismissed. The code follows the existing patterns in the codebase for session management and properly reuses the same tab ID while replacing the session.

@dgageot dgageot merged commit 726f440 into docker:main Mar 20, 2026
8 checks passed
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.

Add /clear command

3 participants