Skip to content

feat(session): add per-group session reset configuration#8134

Closed
tylerliu612 wants to merge 3 commits into
openclaw:mainfrom
tylerliu612:feature/per-group-session-reset
Closed

feat(session): add per-group session reset configuration#8134
tylerliu612 wants to merge 3 commits into
openclaw:mainfrom
tylerliu612:feature/per-group-session-reset

Conversation

@tylerliu612

@tylerliu612 tylerliu612 commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Add support for configuring session reset settings at the per-group level, not just globally or by type/channel.

Motivation

Closes #8122

Some use cases require different session reset behaviors for different groups:

  • TTS groups: Each message is an independent translation task, so sessions should auto-reset after 1 minute idle
  • Family/chat groups: Should maintain normal session continuity

Changes

  • Add TelegramGroupSessionConfig type with reset config options (mode, atHour, idleMinutes)
  • Add session field to TelegramGroupConfig
  • Add Zod schema validation for group session config
  • Add resolveGroupResetConfig helper to extract group-level reset config
  • Modify reset policy resolution to prioritize group config over channel/type defaults

Example Configuration

{
  "channels": {
    "telegram": {
      "groups": {
        "-5117810383": {
          "requireMention": false,
          "session": {
            "reset": {
              "mode": "idle",
              "idleMinutes": 1
            }
          }
        }
      }
    }
  }
}

Testing

  • Build passes ✅
  • Unit tests (pending CI)
  • Manual testing with TTS groups

Greptile Overview

Greptile Summary

Adds per-Telegram-group session reset configuration (channels.telegram.groups.*.session.reset) and updates session initialization to prefer group-level reset overrides over channel/type defaults. Also extends the Telegram config types and Zod validation schema to accept the new session block under group configs.

Confidence Score: 4/5

  • This PR is generally safe to merge, but multi-account Telegram setups may apply the wrong per-group reset policy in some configurations.
  • Changes are localized and schema-backed, but the new lookup for per-group reset config does not tie multi-account group selection to the inbound account context, which can lead to incorrect behavior depending on config ordering.
  • src/auto-reply/reply/session.ts

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Add support for configuring session reset settings at the per-group level,
not just globally or by type/channel.

Changes:
- Add TelegramGroupSessionConfig type with reset config options
- Add session field to TelegramGroupConfig
- Add Zod schema validation for group session config
- Add resolveGroupResetConfig helper to extract group-level reset
- Modify reset policy resolution to prioritize group config

This allows configuring different reset behaviors for different groups,
e.g., TTS groups can auto-reset after 1 minute idle while family groups
keep normal session continuity.

Closes openclaw#8122

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread src/auto-reply/reply/session.ts
- Add accountId field to GroupKeyResolution type
- Propagate AccountId from MsgContext to GroupKeyResolution
- Use accountId in resolveGroupResetConfig for deterministic lookup
- Fallback to scanning all accounts when accountId is not available

Fixes nondeterministic behavior when same groupId exists in multiple accounts
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels Feb 21, 2026
@mudrii

This comment was marked as spam.

@mudrii

This comment was marked as spam.

@mudrii

This comment was marked as spam.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Mar 7, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #pr-thunderdome-dangerzone on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

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

Labels

stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Per-group session reset configuration

2 participants