Skip to content

fix: /new command dispatch for all modes, not just topics (#236)#242

Merged
Nathan Schram (nathanschram) merged 1 commit intodevfrom
fix/new-command-dispatch-236
Mar 29, 2026
Merged

fix: /new command dispatch for all modes, not just topics (#236)#242
Nathan Schram (nathanschram) merged 1 commit intodevfrom
fix/new-command-dispatch-236

Conversation

@nathanschram
Copy link
Copy Markdown
Member

Summary

  • /new was only handled in _dispatch_builtin_command() when topics.enabled=true. With topics disabled (assistant mode), the command fell through to prompt dispatch and triggered an engine run instead of clearing sessions.
  • Moved /new out of the topics.enabled gate, mirroring the /ctx pattern (handles topic, chat session, and stateless modes)
  • Added chat_session_store and chat_session_key to TelegramCommandContext
  • Removed unreachable early routing for /new (40 lines)

Test plan

  • 1817 unit tests pass, 81.38% coverage
  • /new in all 6 forum topic engine chats → "no stored sessions" (not engine run)
  • /new in project supergroup chat → "🧹 cleared stored sessions" (unchanged)
  • ruff check + format clean

Fixes #236

🤖 Generated with Claude Code

`/new` was only handled in `_dispatch_builtin_command()` when
`topics.enabled=true`. With topics disabled (assistant mode), the
command fell through to prompt dispatch and triggered an engine run.

- Move `/new` out of the `topics.enabled` gate, mirroring `/ctx`
  pattern: topic → `handle_new_command`, chat session →
  `handle_chat_new_command`, stateless → cancel + reply
- Add `chat_session_store` and `chat_session_key` to
  `TelegramCommandContext` dataclass
- Remove unreachable early routing for `/new` at lines 1871-1910
  (now handled by `_dispatch_builtin_command`)

Verified: all 6 engine forum topic chats return "no stored sessions"
instead of triggering runs. Project supergroup chats unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bd8ad04c-778e-49bb-9d89-e76a880d8461

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/new-command-dispatch-236

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nathanschram Nathan Schram (nathanschram) merged commit 670320a into dev Mar 29, 2026
21 checks passed
@nathanschram Nathan Schram (nathanschram) deleted the fix/new-command-dispatch-236 branch March 29, 2026 08:51
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