Skip to content

feat: Add ability to clear conversation history within the same session #358

@konokenj

Description

@konokenj

Feature Request

Add the ability to clear/reset conversation history within the same EC2 instance session without starting a new session.

Use Case

When working on a long session, the conversation history can grow large and may include outdated context that is no longer relevant. Users may want to:

  1. Clear history to start fresh with a new task on the same instance
  2. Reset context when switching to a different topic
  3. Reduce token usage by removing irrelevant historical messages

Current Behavior

  • Conversation history is stored in DynamoDB and persists for the entire session
  • No way to clear history without starting a new session (new EC2 instance)
  • Existing Slack commands: approve_user, dump_history, take_over - none for clearing

Proposed Solution

Option A: Slack Command

Add a clear_history command that clears all messages for the current thread/session.

@remote-swe clear_history

Option B: Web UI Button

Add a "Clear History" button in the session page UI.

Option C: Both

Implement both Slack command and Web UI button for flexibility.

Implementation Considerations

  • Should preserve session metadata (repo info, etc.) while clearing messages
  • May need confirmation prompt to prevent accidental clearing
  • Could optionally keep the last N messages or system context
  • Need to handle the case where agent is currently processing

Related Files

  • packages/slack-bolt-app/src/app.ts - Slack command handlers
  • packages/agent-core/src/lib/messages.ts - Message storage (needs delete function)
  • packages/webapp/src/app/sessions/[workerId]/actions.ts - Web UI actions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions