Skip to content

fix(slack): recover context after a lost first turn - #3613

Open
overlord-letta wants to merge 1 commit into
mainfrom
overlord/recover-slack-bootstrap-context
Open

fix(slack): recover context after a lost first turn#3613
overlord-letta wants to merge 1 commit into
mainfrom
overlord/recover-slack-bootstrap-context

Conversation

@overlord-letta

Copy link
Copy Markdown
Contributor

Summary

  • recover persisted Slack thread routes whose first user turn never reached the conversation
  • use durable user-message history as bootstrap proof, then persist a route marker so healthy threads keep the existing incremental behavior
  • cover restart recovery through the real Slack preparation and notification-formatting boundary, including root text, prior human context, and root attachments

Before / after

Before, route existence alone disabled first-turn hydration. If route creation survived but the first delivery did not, a later message such as bump arrived without the original thread context.

After, an unmarked existing Slack channel route checks for a persisted user message. Empty routed conversations re-run first-turn hydration; once a user turn is durable, the route is marked and future turns stay incremental without repeated history probes.

Limits and risk

  • scoped to existing Slack channel/thread routes; direct-message and non-Slack routing are unchanged
  • backend probe failures preserve the existing incremental behavior rather than speculatively replaying thread history
  • legacy routes incur one lightweight user-message probe before receiving the durable marker

Test plan

  • bun test src/channels/slack-registry.test.ts src/channels/slack/thread-context.test.ts src/channels/routing.test.ts — 19 passed
  • regression test fails against the buggy base when applied without the source fix
  • bun run check — all 12 checks passed in an isolated worktree with dependencies installed from the rebased lockfile
  • full unit runner: 694 passed; 7 unrelated src/websocket/app-server.test.ts WebSocket error-event tests fail in this environment and were also reproduced from the untouched main checkout

Overlord (agent-c2adbf5c-8419-4211-8cd8-3740db164974)

Letta Code (agent-c2adbf5c-8419-4211-8cd8-3740db164974)

Persist bootstrap proof only after a routed conversation contains a durable user turn, so interrupted first deliveries can rehydrate the original Slack thread without replaying context on healthy routes.

Co-authored-by: Cameron Pfiffer <cameron@pfiffer.org>

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
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.

2 participants