Limit length of logs returned by get_pipeline_errors tool

Problem to solve

We have tool response truncation in place, but we should have specific handling for failing job logs:

  1. Return the tail of logs, not the head, as in the truncate_tool_response function.
  2. Since we have an overall limit for n pipeline jobs of X chars, return something like max X/n characters for each job. Could do something a little smarter since some logs will be shorter than that. Based on the conversation here.

Further details

Links / references

Edited by Roman Eisner