stacklok / stacklok/mecatl

Slack bot: persist thread-to-session bindings across restarts

Open
#1,399 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
152
Forks
16
Avg merge
14h 48m
Merged PRs (30d)
536

Description

Summary

Persist the mapping between Slack conversations and Mecatl sessions so a bot
restart can resume an existing conversation.

The bot currently stores this mapping in process memory. After a restart, a
message in an existing Slack thread creates a new Mecatl session even when the
previous session remains available on the server.

Scope

  • Define a durable record for the Slack team, channel or DM, thread, and
    Mecatl session identifier.
  • Preserve the current one-session-per-DM and one-session-per-channel-thread
    behavior.
  • Validate the recorded session through the SDK before reuse.
  • Define behavior for missing, deleted, inaccessible, terminal, and stale
    sessions.
  • Prevent one Slack conversation or principal from adopting another
    conversation's session.
  • Make updates atomic enough that a crash cannot silently bind a thread to an
    unrelated session.
  • Add restart and stale-record tests.

Completion criteria

  • Restarting the bot preserves multi-turn context for a valid Slack
    conversation.
  • Invalid records fail closed and create a fresh session only under the
    documented recovery rule.
  • Concurrent messages cannot produce conflicting durable bindings.

References

  • #883 and the session-map TODO in
    sdk/typescript/examples/slack-bot/src/bridge.ts.
  • The Slack bot integration roadmap parent.

Fully or partially written by an AI agent.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the session-map TODO and Slack bridge in sdk/typescript/examples/slack-bot/src/bridge.ts, then review issue #883 and the SDK session-validation path. Define the durable binding and recovery behavior for missing, inaccessible, terminal, or stale sessions, and add restart, stale-record, and concurrency tests. Done means valid conversations resume safely while invalid or conflicting bindings fail closed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.