Skip to content

fix: use agent context_window_size across all channels instead of hardcoded limits#344

Open
nap-liu wants to merge 1 commit intodataelement:mainfrom
nap-liu:pr/context-window-dynamic
Open

fix: use agent context_window_size across all channels instead of hardcoded limits#344
nap-liu wants to merge 1 commit intodataelement:mainfrom
nap-liu:pr/context-window-dynamic

Conversation

@nap-liu
Copy link
Copy Markdown

@nap-liu nap-liu commented Apr 8, 2026

Summary

  • Remove redundant history[-ctx_size:] truncation in _call_agent_llm — SQL .limit() already handles it
  • Ensures agent's configured context_window_size is respected consistently

Test plan

  • Verified no hardcoded truncation in _call_agent_llm
  • Backend runtime verification passed

…dcoded limits

Remove redundant history[-ctx_size:] slicing in _call_agent_llm since
all callers already truncate history via SQL .limit(ctx_size). The
remaining channel handlers (websocket, dingtalk, discord, slack, wecom,
teams, discord_gateway, wecom_stream) already use
agent.context_window_size with DEFAULT_CONTEXT_WINDOW_SIZE=100 fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.

1 participant