Skip to content

Conversation

@Fabilin
Copy link
Member

@Fabilin Fabilin commented Dec 29, 2025

fixes #1972 and adds some debug info to story handler coroutines

Copy link

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

This PR fixes issue #1972 related to the story listener and improves coroutine debugging in story handlers. The main issue was that AsyncBotBus.botBus was being used where the synchronous bus should be accessed, causing listener methods to receive the wrong bus type.

Key Changes:

  • Renamed AsyncBotBus.botBus to AsyncBotBus.syncBus to clarify it provides access to the synchronous BotBus, with the old property name deprecated
  • Fixed the incorrect package name for AsyncStoryHandlerListener (moved from ai.tock.bot.definition.definition to ai.tock.bot.definition)
  • Added coroutine naming for debug purposes when running in development environment

Reviewed changes

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

Show a summary per file
File Description
shared/src/main/kotlin/coroutines/TockCoroutines.kt Refactored fire-and-forget functions: extracted logger to module level, improved documentation, updated return types to Job for better lifecycle management
bot/engine/src/test/kotlin/definition/AsyncBotEngineTest.kt Fixed test to use syncBus instead of deprecated botBus property
bot/engine/src/main/kotlin/engine/dialog/Story.kt Fixed story listener to correctly pass syncBus to non-async listeners; corrected package import for AsyncStoryHandlerListener
bot/engine/src/main/kotlin/engine/Bot.kt Added helper function to generate debug coroutine names in dev environment; integrated coroutine naming into story handler execution
bot/engine/src/main/kotlin/engine/AsyncBotBus.kt Renamed botBus property to syncBus throughout the class with proper deprecation; updated all internal references to use new name
bot/engine/src/main/kotlin/definition/AsyncStoryHandlerListener.kt Fixed incorrect package name from ai.tock.bot.definition.definition to ai.tock.bot.definition
bot/engine/src/main/kotlin/definition/AsyncStoryHandlerBase.kt Updated to use syncBus; added deprecated handle(BotBus) override with coroutine naming support; refactored findStoryDefinition

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

@vsct-jburet vsct-jburet merged commit 22359bb into master Jan 7, 2026
7 checks passed
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.

[Bot Engine] AsyncStoryHandlerListener.startAction is called twice for each action

4 participants