Skip to content

Feature create new session#1311

Open
wmalgadey wants to merge 5 commits intoqwibitai:mainfrom
wmalgadey:feature-add-new-session
Open

Feature create new session#1311
wmalgadey wants to merge 5 commits intoqwibitai:mainfrom
wmalgadey:feature-add-new-session

Conversation

@wmalgadey
Copy link
Copy Markdown

@wmalgadey wmalgadey commented Mar 21, 2026

Type of Change

  • Feature skill - adds a channel or integration (source code changes + SKILL.md)
  • Utility skill - adds a standalone tool (code files in .claude/skills/<name>/, no source changes)
  • Operational/container skill - adds a workflow or agent skill (SKILL.md only, no source changes)
  • Fix - bug fix or security fix to source code
  • Simplification - reduces or simplifies source code
  • Documentation - docs, README, or CONTRIBUTING changes only

Description

We add a /new-session chat command that lets users clear the current Claude SDK session for a group, forcing the next message to start with a clean conversation history. The command is handled entirely by the host process before routing to the agent, so the agent never sees it. We used the /remote-control feature for reference.

In non-main groups it is restricted to the device owner (is_from_me); in the main group any sender can use it, and a /new-session <folder> variant allows clearing another group's session by folder name.

Also added an IPC command to reset the current sessionId inside running containers.

The global CLAUDE.md is updated to document /new-session alongside /remote-control so the agent can inform users about available commands.

solves #1211

- [x] tested on local and new installation

Copilot AI review requested due to automatic review settings March 21, 2026 19:06
Copy link
Copy Markdown

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

Adds a new host-intercepted chat command to reset conversation session state for a group, addressing the need to start fresh without accumulated history.

Changes:

  • Add /new-session (and main-group-only /new-session <folder>) command handling in the host message router.
  • Add deleteSession(groupFolder) DB accessor and accompanying unit tests.
  • Document /new-session alongside existing host-level commands in the global CLAUDE.md.

Reviewed changes

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

File Description
src/index.ts Intercepts /new-session and clears stored session state.
src/db.ts Adds deleteSession to remove a session row by group_folder.
src/db.test.ts Adds coverage verifying deleteSession behavior.
groups/global/CLAUDE.md Documents /new-session as a host-handled command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wmalgadey wmalgadey force-pushed the feature-add-new-session branch from cdbdf5a to 39f0e00 Compare April 2, 2026 20:59
@wmalgadey
Copy link
Copy Markdown
Author

@alaminrifat and @gavrielc test this functionality in my local installation. Works as expected.

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