executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
serpapi-rate-limitsDiscover SerpAPI account throughput and allowance dynamically, then enforce admission, concurrency, and retry budgets. Use when preventing 429s or coordinating search workers. Trigger with "configure SerpAPI rate limits".
Independent GitHub snapshot · Automated classification · Original documentation governs
Use the account's live contract as the source of truth instead of embedding plan names or numeric limits in code.
Use Read, Glob, and Grep to inventory producers and retry loops, WebFetch to verify current Account API and status semantics, Write or Edit for admission controls and observability, and Bash(python3:*) for an approved capacity check or load simulation.
Account API returns fields including plan_searches_left, total_searches_left, this_hour_searches, and account_rate_limit_per_hour. HTTP 429 can mean the hourly throughput limit was exceeded or the account ran out of searches, so the response alone does not identify the remedy.
Use a server-side SERPAPI_KEY for Account API and search calls. Centralize capacity across every workload sharing that credential; do not expose account fields or the key through a public health endpoint.
Return the producer inventory, live capacity snapshot, admission and concurrency budgets, 429 decision tree, retry policy, test evidence, alerts, and rollback owner.
| Condition | Response |
|---|---|
| Account API unavailable | Fail closed to a conservative cached budget with an expiry. |
| Throughput exhausted | Pause and drain; do not amplify with immediate retries. |
| Searches exhausted | Stop allowance-consuming work and route to the account owner. |
| Multiple uncoordinated workers | Introduce a shared limiter before increasing parallelism. |
account = client.account()
hourly_limit = int(account["account_rate_limit_per_hour"])
used_this_hour = int(account["this_hour_searches"])
headroom = max(0, hourly_limit - used_this_hour)
admission_budget = max(0, int(headroom * 0.8)) # reserve 20% for priority traffic
Review the live capacity at renewal and whenever a new worker or search product begins sharing the account.