Skip to content

Accept a custom conversation store in the server config #114

Closed

Description

@anurag629

The README says conversations have "pluggable stores on server", and @chatcops/core has the pieces for it: the ConversationStore interface (packages/core/src/conversation/store.ts) and a store option on ConversationManager. But the server never passes one. createChatHandler calls new ConversationManager() with no arguments (packages/server/src/handler.ts, line 19), and ChatCopsServerConfig has no field for it.

So every deployment keeps its history in memory. It's gone after a restart and isn't shared between instances, which on Cloudflare Workers means between isolates.

What to do

  • Add conversationStore?: ConversationStore to ChatCopsServerConfig (packages/server/src/config.ts) and pass it to ConversationManager. maxMessages can come along if you like.
  • Without the option, behavior stays exactly as it is.
  • Document it in website/src/content/docs/server/setup.mdx and packages/server/README.md, with a short example of a store.

Acceptance criteria

  • The config accepts a store and has a JSDoc comment for it; the default is unchanged
  • A test proves the handler reads and writes through a supplied store. Use a store that JSON-clones on get and save, like a real database would, so nothing depends on shared object references
  • The docs and the server README show the option
  • pnpm -r build, pnpm test and pnpm -r typecheck pass
  • Changeset for @chatcops/server (minor)

Test note: packages/server/tests/handler.test.ts replaces ConversationManager with a fake, so this test needs its own file that keeps the real @chatcops/core and mocks only createProvider.


Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

Activity

  1. added
    enhancementNew feature or request
    help wantedExtra attention is needed
    serverAffects @chatcops/server package
    hacktoberfestGood pick for Hacktoberfest contributors
    on Oct 11, 2026
  2. bhushan4work commented on Oct 19, 2026

    @bhushan4work
    Collaborator

    @anurag629 I'd like to work on this one .

  3. anurag629 commented on Oct 19, 2026

    @anurag629
    MemberAuthor

    Hey @bhushan4work, it's yours, next to toolbelt #46. #161 just moved new ConversationManager() down to line 19 of handler.ts, and I've updated that in the issue.

    Let me know if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthacktoberfestGood pick for Hacktoberfest contributorshelp wantedExtra attention is neededserverAffects @chatcops/server package

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions