Files
João MouraandClaude Opus 5.5 c81633aca1 feat(agents): read spreadsheet URLs in an agent's input with tools over every row (#9234)
* feat(agents): read spreadsheet URLs in an agent's input with tools over every row

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* fix(agents): fetch only spreadsheet URLs a caller gave, and harden reading them

Review found model-written URLs reaching the download (delegated tasks, string
guardrails, crew planning, crew chat), a crash on CJK punctuation after a URL,
an agent's own tools dropped with tools=[], repeated downloads, no cap on URLs,
unsanitized names in the prompt, and URL extraction gaps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* fix(agents): keep model and remote text out of spreadsheet trust, bound downloads

- Record a task's caller-written description before crew planning, crew-chat
  history or A2A text is added, and carry it through Task.copy and
  checkpoints (checkpoint_input_description); a template captured after a
  planned run no longer keeps the plan.
- Decode only ";"-terminated character references before matching URLs, so
  escaped quotes and brackets end a URL, non-ASCII never reaches urlparse,
  and query names like "&para=" survive.
- Read at most 10 URLs and add one line for the rest; number same-named
  files in linear time.
- Share one 60s deadline across a run's downloads (new `deadline` keyword on
  safe_get_bounded), prune expired cached bodies, and find names that start
  with a quote.
- Docs: the cap and download limit, in en, ar, ko and pt-BR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* fix(agents): cut stalled spreadsheet downloads at the deadline, trust every caller URL

- safe_get_bounded: a watchdog shuts down every socket the download opened
  once the deadline passes (registered by the SSRF adapter at connect), so a
  server trickling bytes in the headers or body can no longer outlast it.
  Checking after each iter_content chunk never fired: a 64 KiB chunk can take
  weeks to fill at one byte per read timeout.
- Empty inputs keep the caller text the last inputs filled in, matching the
  description (kickoff_async() passes {}).
- A run trusts every spreadsheet URL its input gave, read or not, so a
  coworker can read one past the cap or after a failed download.
- Make an implicit string concatenation in a test explicit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* fix(agents): cut sockets that connect after the deadline, and keep old checkpoints closed

- A socket that connects after the download deadline passed (the next
  redirect hop) is shut down as it is watched; before, only sockets already
  in the list when the timer fired were.
- A checkpoint now always records the caller's text, so a missing field marks
  one written before 1.15.38. Such a task reads spreadsheet URLs only from the
  template the caller wrote, not from a description crew planning or chat
  history was added to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* fix(agents): never cache spreadsheet answers, trim URLs in linear time, tame sheet names

- The spreadsheet tools never write to the tool cache. In a Crew with
  cache=True, a second task whose file had the same name got the first
  task's answer back.
- _trim walks a URL once from the end; a long run of ")" was quadratic.
- Sheet names are cut to Excel's 31 characters and their double quotes turned
  into single ones, so a crafted name can't close the quotes it is shown in.
  The name shown is the name the tools accept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* docs: model output put into an agent's input counts as its input

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* fix(agents): an old checkpoint's unknown caller text stays unknown on resume

A task restored from a checkpoint from before 1.15.38 without a template has
"" for its caller text. Interpolating inputs on resume used to replace that
with the description, plan included; now it stays "", through later
checkpoints too, so no spreadsheet URL is read from that task.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* fix(agents): keep prompt placeholders in a file's text from being filled in

AgentExecutor fills {tools} and {tool_names} in after the input is placed,
so a sheet name, header or cell holding one pulled the tool catalog into the
file's data. The overview now shows them as "{ tools }".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

* fix(agents): cut a download stalled in its TLS handshake, and skip huge references

- The watchdog holds a duplicate of each socket's descriptor from the moment
  it connects. Shutting the duplicate down ends a read in the TLS handshake
  too, where the plain socket is already detached into the TLS one, and the
  duplicates are closed when the download ends, so a reused descriptor
  number is never touched. It replaces the connect() overrides.
- Character references are decoded only up to what a code point needs;
  html.unescape raised on more than 4300 digits and aborted the run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfUv1NsUFz1RHjRgS73HBR

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 04:02:41 -03:00
..