Skip to content

feat(core): /new command — reset conversation preserving memory and MCP connections#2464

Merged
bug-ops merged 1 commit intomainfrom
feat/issue-2451/new-command-reset-conversation
Mar 30, 2026
Merged

feat(core): /new command — reset conversation preserving memory and MCP connections#2464
bug-ops merged 1 commit intomainfrom
feat/issue-2451/new-command-reset-conversation

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 30, 2026

Summary

  • Adds /new slash command that resets conversation history, tool call cache, and context budget without touching memory (SQLite + Qdrant), MCP connections, or provider config
  • Fail-fast pattern: new conversation ID created in SQLite before any in-memory state mutation
  • All active async handles (compression, sidequest, subgoal, plan, subagents) cancelled before state reset
  • Optional --no-digest flag skips carry-over session digest; --keep-plan preserves pending orchestration graph
  • Session digest generated as a 30s-bounded fire-and-forget background task
  • TUI spinner emitted via status_tx around the reset operation
  • Channel-generic implementation: identical behavior across CLI, TUI, and Telegram

Changed Files

  • slash_commands.rs — registered /new [--no-digest] [--keep-plan] under Session category
  • mod.rs/new arm in handle_builtin_command with flag parsing
  • context/assembly.rsreset_conversation() + spawn_outgoing_digest helper
  • context_manager.rsreset_compaction() method
  • focus.rsFocusState::reset() method
  • sidequest.rsSidequestState::reset() method
  • session_digest.rsgenerate_and_store_digest free function for background use

Tests

7342 passed (+3 vs baseline). New unit tests:

  • reset_compaction_clears_exhausted_state
  • reset_clears_all_session_state
  • reset_zeroes_all_counters

Follow-ups (non-blocking)

  • IndexState.cached_repo_map and trace_collector.active_iterations not cleared on reset (TTL-based, cosmetic)

Closes #2451

@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate enhancement New feature or request size/L Large PR (201-500 lines) labels Mar 30, 2026
…ession state

Implements /new slash command that resets conversation history, tool call
cache, and context budget without reinitializing memory (SQLite + Qdrant),
MCP connections, or provider configuration.

- Fail-fast: new conversation ID created in SQLite before any state mutation
- Aborts in-flight JoinHandles (compression, sidequest, subgoal tasks)
- Cancels running plan token and shuts down active subagents
- Optional --no-digest flag skips carry-over session digest generation
- Optional --keep-plan flag preserves pending orchestration graph
- Background digest generation (30s bounded, fire-and-forget)
- TUI spinner emitted via status_tx before and after reset
- Channel-generic: works identically across CLI, TUI, and Telegram
- 3 unit tests for reset_compaction, FocusState::reset, SidequestState::reset

Closes #2451
@bug-ops bug-ops force-pushed the feat/issue-2451/new-command-reset-conversation branch from a1a30a4 to 4056c88 Compare March 30, 2026 19:57
@bug-ops bug-ops enabled auto-merge (squash) March 30, 2026 19:57
@bug-ops bug-ops merged commit 8dea142 into main Mar 30, 2026
27 checks passed
@bug-ops bug-ops deleted the feat/issue-2451/new-command-reset-conversation branch March 30, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tui): /new command — reset conversation window while preserving session state (filesystem, memory, processes)

1 participant