Skip to content

Upper time bound for simple (non-research) greedy searches (~2 min) #57

Description

@apmantza

Summary

Simple greedy_search calls (individual engines and engine: "all" without depth: "research") have no overall wall-clock deadline. Only per-extractor runExtractor timeouts exist (src/search/engines.mjs:21-40): 60s default, 70s gemini, 80s chatgpt, 120s logically.

Problem

Total time for one tool call can exceed 2 minutes because multiple budgets stack:

  • engine: "all" fans out to N engines (each up to 60-80s) + source fetching after all engines finish (bin/search.mjs)
  • Visible-recovery retry re-runs a blocked engine in visible mode after the headless attempt already timed out
  • A single extractor's in-browser eval can hang until the CDP/nav timeout (e.g. logically burned the full ~113s on answer-wait today)

Requested behavior

In depth: "research" mode the per-round budgets already exist (src/search/research.mjs). For simple (non-research) searches, add a hard overall ceiling — ~2 minutes — that caps the entire call (fan-out + source fetch + any visible recovery), kills in-flight extractor children, and returns a clear TimeLimitExceeded error so the caller isn't left hanging.

Constraints:

  • Must still return partial results if some engines finished before the deadline (consistent with the resilient-synthesis design).
  • Apply to the CLI path (bin/search.mjs) and the Pi tool path (src/tools/greedy-search-handler.ts).
  • Research mode must remain unaffected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions