Skip to content

feat: add /new command to reset agent chat session#18

Open
yhurynovich wants to merge 1 commit into
ForgetMeAI:mainfrom
yhurynovich:dev
Open

feat: add /new command to reset agent chat session#18
yhurynovich wants to merge 1 commit into
ForgetMeAI:mainfrom
yhurynovich:dev

Conversation

@yhurynovich

@yhurynovich yhurynovich commented Jun 16, 2026

Copy link
Copy Markdown

Detect when the latest user message is exactly "/new" (trimmed) and short-circuit the request to reset that agent's session instead of forwarding it to DeepSeek.

  • Reuses the existing createSession()/sessions map used by the /reset-session endpoint, so behavior stays consistent
  • Returns a confirmation reply via buildTextResponse(), respecting the active API mode (OpenAI, Anthropic, Responses) and streaming vs non-streaming
  • No DeepSeek API call is made for the /new turn itself
  • Per-agent: only resets the session for the requesting agentId, not all sessions

Detect when the latest user message is exactly "/new" (trimmed)
and short-circuit the request to reset that agent's session
instead of forwarding it to DeepSeek.

- Reuses the existing createSession()/sessions map used by the
  /reset-session endpoint, so behavior stays consistent
- Returns a confirmation reply via buildTextResponse(), respecting
  the active API mode (OpenAI, Anthropic, Responses) and
  streaming vs non-streaming
- No DeepSeek API call is made for the /new turn itself
- Per-agent: only resets the session for the requesting agentId,
  not all sessions

Mounted via docker-compose volume override so the patch survives
container rebuilds without modifying the Dockerfile.
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.

1 participant