fix: include url in web_extract trimmed results & fix docs

The web_extract_tool was stripping the 'url' key during its output
trimming step, but documentation in 3 places claimed it was present.
This caused KeyError when accessing result['url'] in execute_code
scripts, especially when extracting from multiple URLs.

Changes:
- web_tools.py: Add 'url' back to trimmed_results output
- code_execution_tool.py: Add 'title' to _TOOL_STUBS docstring and
  _TOOL_DOC_LINES so docs match actual {url, title, content, error}
  response format
This commit is contained in:
teknium1 2026-03-07 18:07:36 -08:00
parent 7bccd904c7
commit 3830bbda41
2 changed files with 3 additions and 2 deletions

View file

@ -787,6 +787,7 @@ async def web_extract_tool(
# Trim output to minimal fields per entry: title, content, error
trimmed_results = [
{
"url": r.get("url", ""),
"title": r.get("title", ""),
"content": r.get("content", ""),
"error": r.get("error"),