All Questions
Agents And Tool Use medium

An agent's `search_logs` tool sometimes returns around 200K tokens of matching lines. Those results overflow the context window and crash the run. Which approach best balances completeness and stability?

  1. A Return the full output but instruct the model to read only the first part, relying on it to ignore the remaining log lines.
  2. B Truncate results to a few thousand tokens with a note on what was cut, and offer pagination or filter params for more.
  3. C Automatically switch to a model with a larger context window whenever a tool result exceeds the current model's limit.
  4. D Silently drop any tool result over the limit and return an empty success so the agent loop continues without interruption.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions