All Questions
Agents And Tool Use hard

A `query_logs` tool can return up to 200,000 tokens. The team truncates its output to the first 4,000 tokens. The agent now reports 'no errors found' for incidents whose errors appear late in the log window. What is the best fix?

  1. A Shape the tool to filter and aggregate server-side, returning bounded results with counts, a cursor, and an explicit truncation flag.
  2. B Raise the truncation limit to the full 200,000 tokens, since the model's context window can hold the complete log output.
  3. C Switch from head to tail truncation, because in most incidents the relevant errors cluster near the end of the log window.
  4. D Summarize the full output with a separate model call before returning it, so the agent gets complete coverage of the logs in far fewer tokens.

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

Get the app

Related questions