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
Skip widget, session URL, and page_size prompt for internal clients (#240)
* Skip widget, session URL, and page_size prompt for internal clients
Detect requests from EveryRow CC (via User-Agent) and strip widget JSON,
session URL references, and submission widget from responses. This saves
bandwidth and context tokens for our own app which has its own UI.
Also adds auto_page_size_threshold setting (default 50, configurable via
AUTO_PAGE_SIZE_THRESHOLD env var) — when total rows are at or below the
threshold, the agent loads all rows directly instead of asking the user.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix page_size=0 bug and add everyrow-cc to widget blocklist
- Guard against total=0 producing page_size=0 (fails ge=1 validation)
- Add "everyrow-cc" to _NO_WIDGET_UA_SUBSTRINGS so client_supports_widgets
is self-consistent without needing an override in the results handler
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
completed_msg=f"Completed: {self.completed}/{self.total} ({self.failed} failed) in {self.elapsed_s}s."
409
435
ifsettings.is_http:
410
-
next_call=dedent(f"""\
411
-
IMPORTANT: Do NOT call everyrow_results yet.\
412
-
First, ask the user: "The task produced {self.total} rows. How many would you like me to load into my context so I can read them? (default: 50). You will have access to all of them via the widget.".\
413
-
The answer the user provides will correspond to the `page_size`.\
414
-
After the user responds, call everyrow_results(task_id='{task_id}', page_size=N).""")
436
+
ifself.total<=settings.auto_page_size_threshold:
437
+
next_call=dedent(f"""\
438
+
Call everyrow_results(task_id='{task_id}', page_size={max(self.total, 1)}) to load all rows.""")
439
+
else:
440
+
next_call=dedent(f"""\
441
+
IMPORTANT: Do NOT call everyrow_results yet.\
442
+
First, ask the user: "The task produced {self.total} rows. How many would you like me to load into my context so I can read them? (default: 50). You will have access to all of them via the widget.".\
443
+
The answer the user provides will correspond to the `page_size`.\
444
+
After the user responds, call everyrow_results(task_id='{task_id}', page_size=N).""")
415
445
else:
416
446
next_call=f"Call everyrow_results(task_id='{task_id}', output_path='<choose_a_path>.csv') to save the output."
0 commit comments