Skip to content

Cherry-pick a7929abad: Discord thread bindings idle + max-age lifecycle#1395

Merged
alexey-pelykh merged 4 commits intomainfrom
cherry-pick/a7929abad-discord-thread-lifecycle
Mar 15, 2026
Merged

Cherry-pick a7929abad: Discord thread bindings idle + max-age lifecycle#1395
alexey-pelykh merged 4 commits intomainfrom
cherry-pick/a7929abad-discord-thread-lifecycle

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Cherry-pick of upstream a7929abad.

Author: Onur Solmaz (osolmaz)

Upstream PR: openclaw#27845

Summary

Refactors Discord thread binding lifecycle from a single TTL to separate idle timeout + max-age:

  • sessionTtl / ttlHoursidleHours + maxAgeHours
  • /session ttl command → /session idle + /session max-age
  • Inactivity-based unfocus with separate hard max-age expiry
  • Legacy expiresAt bindings auto-migrated to idle/max-age semantics
  • Config migration rule for ttlHoursidleHours

Fork Adaptations

  • Dropped ACP (Agent Component Protocol) code — gutted layer in fork
  • Dropped ACP reconciliation, session identifiers, and persona modules
  • Kept inlined message functions (our fork inlines from deleted channels/thread-bindings-messages.ts)
  • Updated 🤖 prefix (fork branding) in intro/farewell messages
  • Rebranded OPENCLAW_STATE_DIRREMOTECLAW_STATE_DIR in migration test
  • Dropped nativeSkills references (gutted in fork)

Closes #675 (partial — commit 1/26)

🤖 Generated with Claude Code

osolmaz and others added 4 commits March 15, 2026 07:37
…hanks @osolmaz)

* refactor discord thread bindings to idle and max-age lifecycle

* fix: migrate legacy thread binding expiry and reduce hot-path disk writes

* refactor: remove remaining thread-binding ttl legacy paths

* fix: harden thread-binding lifecycle persistence

* Discord: fix thread binding types in message/reply paths

* Infra: handle win32 unknown inode in file identity checks

* Infra: relax win32 guarded-open identity checks

* Config: migrate threadBindings ttlHours to idleHours

* Revert "Infra: relax win32 guarded-open identity checks"

This reverts commit de94126.

* Revert "Infra: handle win32 unknown inode in file identity checks"

This reverts commit 96fc5dd.

* Discord: re-read live binding state before sweep unbind

* fix: add changelog note for thread binding lifecycle update (openclaw#27845) (thanks @osolmaz)

---------

Co-authored-by: Onur Solmaz <[email protected]>
(cherry picked from commit a7929ab)
- Rebrand OpenClawConfig → RemoteClawConfig in new session lifecycle test
- Use threadId instead of conversation.conversationId (fork structure)
- Add required lastActivityAt to test binding records
- Rebrand OPENCLAW_STATE_DIR → REMOTECLAW_STATE_DIR in persistence tests
…rules

- Delete commands-session-ttl.test.ts (superseded by commands-session-lifecycle.test.ts)
- Add back thread binding ttlHours → idleHours migration rules to legacy.rules.ts
  (these are new rules from the upstream commit, distinct from the pre-existing
  rules that were cleared during fork gutting)
The migration logic was in legacy.migrations.part-1.ts which was deleted
in the fork (all legacy migrations cleared). Add back this specific
migration for the ttlHours→idleHours rename introduced by this commit.
@alexey-pelykh alexey-pelykh merged commit 81589d2 into main Mar 15, 2026
7 checks passed
@alexey-pelykh alexey-pelykh deleted the cherry-pick/a7929abad-discord-thread-lifecycle branch March 15, 2026 07:18
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.

Cherry-pick: Discord adapter fixes

2 participants