You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(integrations): send_template_message is 68 lines, over the function-length limit #21924
autobot-backend/integrations/whatsapp_integration.pysend_template_message (line 451 on main) is 68 lines, over the 65-line limit of the function-length hook. The hook reports it whenever the whole file is checked (pre-commit run --files), which made it show up as a failure in an unrelated PR's pre-push run (#21821, which doesn't touch the function).
Acceptance criteria
send_template_message is split into helpers, each within the function-length limit, with behaviour unchanged
The Function Length Check hook passes with pre-commit run --files autobot-backend/integrations/whatsapp_integration.py on main
Two more functions over the same function-length limit were seen while reviewing #21823. The function-length hook flagged both when it checked the whole file:
autobot-backend/api/a2a.pystream_task_events (line 329 on main), reported at 70 lines.
autobot-backend/api/openai_compat.py_stream_generator (line 260 on main), reported at 85 lines.
This is the same problem as send_template_message, so the fix for this issue covers all three functions; no separate issues will be filed. Each function will be measured with the hook on current main before it is split. Behaviour stays the same, and each split must pass pre-commit run --files <file>.
Closure evidence (merged in #21968, c460f95, ancestor of main):
AC1: on main, autobot-backend/integrations/whatsapp_integration.pysend_template_message L446 is 59 lines; helpers _build_template_payload L507 (12) and _template_response L521 (15). All are under the 65-line limit. Reviewed as behaviour-preserving before merge.
AC2: pre-commit run function-length-check --files autobot-backend/integrations/whatsapp_integration.py on main → Function Length Check (Issue #620)....Passed.
Host evidence: the local install's deployed source is at a238469 (main), which contains the merge c460f95. Read-only check of the deployed whatsapp_integration.py: send_template_message at L446, _build_template_payload at L507, _template_response at L521, matching main.
Activity
mrveiss commentedon Nov 21, 2026
Two more functions over the same function-length limit were seen while reviewing #21823. The function-length hook flagged both when it checked the whole file:
autobot-backend/api/a2a.pystream_task_events(line 329 on main), reported at 70 lines.autobot-backend/api/openai_compat.py_stream_generator(line 260 on main), reported at 85 lines.This is the same problem as
send_template_message, so the fix for this issue covers all three functions; no separate issues will be filed. Each function will be measured with the hook on current main before it is split. Behaviour stays the same, and each split must passpre-commit run --files <file>.Merge pull request #21968 from mrveiss/issue-21924-function-length
mrveiss commentedon Nov 21, 2026
Closure evidence (merged in #21968, c460f95, ancestor of main):
autobot-backend/integrations/whatsapp_integration.pysend_template_messageL446 is 59 lines; helpers_build_template_payloadL507 (12) and_template_responseL521 (15). All are under the 65-line limit. Reviewed as behaviour-preserving before merge.pre-commit run function-length-check --files autobot-backend/integrations/whatsapp_integration.pyon main →Function Length Check (Issue #620)....Passed.mrveiss commentedon Nov 22, 2026
Host evidence: the local install's deployed source is at a238469 (main), which contains the merge c460f95. Read-only check of the deployed
whatsapp_integration.py:send_template_messageat L446,_build_template_payloadat L507,_template_responseat L521, matching main.refactor(backend): split send_template_message, stream_task_events, _…