[kimi-task] Extract hardcoded sats limit in consult_grok() to config #782

Closed
opened 2026-03-21 19:16:51 +00:00 by Timmy · 0 comments
Owner

Type: Config extraction

File: src/timmy/tools.py line 459

In consult_grok(), the Lightning invoice amount has a hardcoded fallback:

sats = min(settings.grok_max_sats_per_query, 100)

The 100 cap is a magic number. Add a grok_sats_hard_cap config field to settings in src/config.py (default: 100) and reference it instead of the literal.

Also, the query truncation query[:50] for the invoice memo is hardcoded — consider making it a constant _INVOICE_MEMO_MAX_LEN = 50 at the top of the file.

Files to change: 2 files — src/config.py, src/timmy/tools.py

**Type:** Config extraction **File:** `src/timmy/tools.py` line 459 In `consult_grok()`, the Lightning invoice amount has a hardcoded fallback: ```python sats = min(settings.grok_max_sats_per_query, 100) ``` The `100` cap is a magic number. Add a `grok_sats_hard_cap` config field to settings in `src/config.py` (default: 100) and reference it instead of the literal. Also, the query truncation `query[:50]` for the invoice memo is hardcoded — consider making it a constant `_INVOICE_MEMO_MAX_LEN = 50` at the top of the file. **Files to change:** 2 files — `src/config.py`, `src/timmy/tools.py`
kimi was assigned by Timmy 2026-03-21 19:16:51 +00:00
kimi added this to the Code Hygiene milestone 2026-03-21 20:25:07 +00:00
Timmy closed this issue 2026-03-22 01:46:16 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#782