-
Notifications
You must be signed in to change notification settings - Fork 415
fix: unify context_window_size fallback defaults across all channels #238
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Background
PR #232 fixed context_window_size persistence and usage in websocket.py and feishu.py. However, multiple other channel integrations still use inconsistent fallback default values.
Problem
When agent.context_window_size is None or 0, different channels fall back to different values:
| File | Current Fallback | Expected |
|---|---|---|
websocket.py:462 |
or 100 |
✅ |
feishu.py:398 |
or 100 |
✅ |
feishu.py:932 |
or 100 |
✅ |
feishu.py:1235 |
or 100 |
✅ |
discord_gateway.py:173 |
or 20 |
❌ |
wecom_stream.py:292 |
or 20 |
❌ |
wecom.py:473 |
or 20 |
❌ |
slack.py:232 |
or 20 |
❌ |
discord_bot.py:294 |
or 20 |
❌ |
teams.py:482 |
or 20 |
❌ |
dingtalk.py:169 |
or 20 |
❌ |
Suggested Fix
- Define a single constant (e.g.
DEFAULT_CONTEXT_WINDOW_SIZE = 100) in a shared location likeapp/models/agent.pyor a config module. - Replace all
or 20/or 100fallbacks with the shared constant. - This ensures consistent behavior across web chat, Feishu, Slack, Discord, WeCom, DingTalk, and Teams channels.
Related
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working