From df7358b3833b579287c093a1aa677dedce466d8c Mon Sep 17 00:00:00 2001 From: "Claude (Opus 4.6)" Date: Mon, 23 Mar 2026 15:07:40 +0000 Subject: [PATCH] [claude] Extract hardcoded sats limit in consult_grok() (#937) (#1058) Co-authored-by: Claude (Opus 4.6) Co-committed-by: Claude (Opus 4.6) --- src/dashboard/routes/grok.py | 2 +- src/timmy_serve/cli.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dashboard/routes/grok.py b/src/dashboard/routes/grok.py index cf6ef33..e00fb2e 100644 --- a/src/dashboard/routes/grok.py +++ b/src/dashboard/routes/grok.py @@ -125,7 +125,7 @@ def _run_grok_query(message: str) -> dict: from lightning.factory import get_backend as get_ln_backend ln = get_ln_backend() - sats = min(settings.grok_max_sats_per_query, 100) + sats = min(settings.grok_max_sats_per_query, settings.grok_sats_hard_cap) ln.create_invoice(sats, f"Grok: {message[:50]}") invoice_note = f" | {sats} sats" except Exception as exc: diff --git a/src/timmy_serve/cli.py b/src/timmy_serve/cli.py index 0cc2a7a..f9d8b24 100644 --- a/src/timmy_serve/cli.py +++ b/src/timmy_serve/cli.py @@ -14,10 +14,15 @@ app = typer.Typer(help="Timmy Serve — sovereign AI agent API") def start( port: int = typer.Option(8402, "--port", "-p", help="Port for the serve API"), host: str = typer.Option("0.0.0.0", "--host", "-h", help="Host to bind to"), - price: int = typer.Option(100, "--price", help="Price per request in sats"), + price: int = typer.Option(None, "--price", help="Price per request in sats (default: from config)"), dry_run: bool = typer.Option(False, "--dry-run", help="Print config and exit (for testing)"), ): """Start Timmy in serve mode.""" + from config import settings + + if price is None: + price = settings.grok_sats_hard_cap + typer.echo(f"Starting Timmy Serve on {host}:{port}") typer.echo(f"L402 payment proxy active — {price} sats per request") typer.echo("Press Ctrl-C to stop")