Skip to content

fix: spill oversized tool errors - #306

Draft
PsiACE wants to merge 2 commits into
bubbuild:mainfrom
PsiACE:fix/spill-tool-errors
Draft

fix: spill oversized tool errors#306
PsiACE wants to merge 2 commits into
bubbuild:mainfrom
PsiACE:fix/spill-tool-errors

Conversation

@PsiACE

@PsiACE PsiACE commented Sep 13, 2026

Copy link
Copy Markdown
Member

Apply spill limits to model-rendered tool results, including structured successes and failures, while preserving small original values and failure state. Adds regression coverage and updates the English and Chinese docs.

Verification:

  • uv run ruff check .
  • uv run mypy src
  • uv run pytest -q (353 passed, 1 skipped)
  • Astro docs build

@PsiACE

PsiACE commented Sep 13, 2026

Copy link
Copy Markdown
Member Author
str   -> text as-is -----+
dict  -> JSON text ------+
list  -> JSON text ------+--> size check
error -> as_dict -> JSON-+        |
                           +-----+-----+
                           |           |
                         small        large
                           |           |
                     keep original  spill full text
                           |           |
                           |     +---------------------------+
                           |     | [spilled: ...; handle: x] |
                           |     | [read: spill_read(...)]   |
                           |     | head ... omitted ... tail|
                           |     +---------------------------+
                           |           |
                           +-----+-----+
                                 |
                                tape
                                 |
                           model context

spill_read -> bounded text page (no re-spill, no JSON auto-parse)
error      -> remains error
preview    -> text only; may not be valid JSON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant