fix(harness): bound generic function result content - #1016
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
skill-check — worker0 verified, 69 skipped (no docs/).
Four for four. Nicely done. |
|
Closing: this behaviour already exists, one layer down, and this change would regress it. The cap is already there
It landed as #801 / MOT-4014, "fix(context-manager): bound context growth from function results" — the same intent as this PR's title. It is not optional:
|
Summary
Prevent oversized generic function results from being duplicated verbatim into both model-facing
contentand structureddetails.This mitigation is function-agnostic. It does not special-case Compose or any other worker.
Previously, when a function returned an arbitrary JSON value without explicit content blocks, Harness serialized the complete value into model-facing text while also retaining the same value in
details. Large function results were therefore duplicated in the transcript.Harness now:
details.Oversized result summary
When implicit serialized content exceeds 16 KiB, the model-facing result contains metadata similar to:
{ "result_omitted_from_content": true, "reason": "result exceeds model-facing inline limit", "type": "object", "serialized_bytes": 68432, "inline_limit_bytes": 16384, "details_available": true, "fields": 2, "field_names": ["containers", "operation_id"] }The original result remains available losslessly in
details.Behavior
Testing
Regression coverage confirms that:
details.Commands run:
cargo test -p harness --lib— 453 tests passedcargo clippy -p harness --lib -- -D warningsRelated PR
Companion Compose source fix: iii-hq/iii#<2107>