Skip to content

fix(api): close inactive threads automatically - #2206

Open
mikemikimike wants to merge 1 commit into
hexabot-ai:mainfrom
mikemikimike:fix/1960-thread-inactivity
Open

fix(api): close inactive threads automatically#2206
mikemikimike wants to merge 1 commit into
hexabot-ai:mainfrom
mikemikimike:fix/1960-thread-inactivity

Conversation

@mikemikimike

@mikemikimike mikemikimike commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Fixes #1960.

  • Add a scheduled cleanup that closes open threads after each source's thread_inactivity_hours threshold.
  • Run cleanup once at application startup and then every minute, reusing the existing closeThread lifecycle.
  • Share the inactivity predicate with incoming-message thread resolution and cover exact-threshold, per-source settings, scheduler, shutdown, and failure behavior.

Validation

Validated from a clean Linux checkout of this PR commit using Node.js 24.17.0 and pnpm 11.8.0:

  • pnpm --filter @hexabot-ai/api run test: 178 suites passed, 1 skipped; 1,234 tests passed, 3 skipped.
  • pnpm --filter @hexabot-ai/api run lint: passed.
  • pnpm --filter @hexabot-ai/api run typecheck: passed.
  • pnpm --filter '@hexabot-ai/api...' run build: passed for the API and its workspace dependency chain.
  • Focused thread service and scheduler regression tests: 21 passed.
  • git diff --check: 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.

[Issue] threads are not closed after thread_inactivity_hours

1 participant