feat(execute_code): stdout spillover — recover truncated output instead of re-running - #97043
Merged
Merged
Conversation
…aved to cache/exec (host) or kernel tmpdir (cells), path + read_file recipe in the result
Contributor
૮ >ﻌ< ა ci reviewran on bc09d3e — feat(execute_code): stdout spillover — truncated output's fu
|
5 tasks
13 tasks
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
…aved to cache/exec (host) or kernel tmpdir (cells), path + read_file recipe in the result (NousResearch#97043)
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
…KB cap (NousResearch#97048) * fix(execute_code): limits line teaches spillover — big stdout is saved, not lost (follow-up to NousResearch#97043) * fix(execute_code): drop the editorializing tail from the limits line (maintainer review)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Maintainer-directed. execute_code's 50KB head(40%)/tail(60%) truncation DISCARDED the middle forever — unlike web_extract, which stores full text to cache/web with a read_file recipe in its footer. This ports that recover-don't-rerun pattern to execute_code, at both layers where clipping happens:
Host-side (
_truncate_stdout_text— kernel results + remote per-call fallback)Full stdout spilled to
cache/exec/stdout-<digest>.txt(content-keyed, so identical reruns coalesce;spill_safety.write_text_exclusive, same hardening as cache/web). Result gainsstdout_spill_path, and the truncationwarningnow teaches the recipe: "FULL output saved to … — page it with read_file(path=…, offset=…) instead of re-running." 5MB spill ceiling mirrors web_tools' MAX_STORED_TEXT_CHARS rationale.Cell-side (kernel runner — clips in the CHILD before replying, so host-side alone can't see the middle)
Runner's
_bounded()spills full text to the kernel tmpdir (HERMES_KERNEL_SPILL_DIR, set at spawn) before clipping; reply carriesstdout_spill_path; host surfaces it with the same recipe plus the kernel-specific hint that variables still exist ("printing a narrower slice next call is often cheaper"). Best-effort at both layers: a failed spill degrades to today's plain clipping, never blocks the result.Verified live (real kernel, temp HERMES_HOME)
~400KB output with a unique needle at the midpoint (inside the discarded window):
One pre-existing test updated: the remote-truncation contract now also asserts the spill path exists and the file holds both HEAD and TAIL (stronger than the old warning-text pin). Per-call remote wording kept path-neutral — the kernel-state hint appears only on the kernel path where it's true.
Suites: 86 passed / 1 pre-existing failure (TestRpcTokenAuthorization). Refs #94647/#96787/#96991 (kernel arc), web_tools
_store_full_text(pattern source).