Skip to content

docs(code-execution): document the session kernel, reset, and stdout spillover - #105784

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
notwitcheer:docs/code-execution-session-kernel
Sep 8, 2026
Merged

kshitijk4poor merged 1 commit into
NousResearch:mainfrom
notwitcheer:docs/code-execution-session-kernel

Conversation

@notwitcheer

Copy link
Copy Markdown
Contributor

What

  • user-guide/features/code-execution.md: new State Between Calls (the session kernel) section: state persists across execute_code calls in a per-session kernel, what ends a kernel (timeout/interrupt, reset=true, idle timeout, eviction), env frozen at spawn, same security envelope per cell, remote-backend kernel with fail-open per-call fallback, and the >50 KB stdout spill to ~/.hermes/cache/exec/ with the path in the result. The Resource Limits stdout row now describes the spill instead of a plain truncation notice.

Why

The page describes project vs strict mode, the minimal environment and the RPC channel, but none of the session-kernel behaviour shipped in v2026.8.31 (#94647, #96787, #96991, #97043). Sources: tools/code_kernel.py docstring, tools/code_kernel_remote.py docstring, tools/code_execution_tool.py:80-96 (spill), hermes_cli/config_defaults.py (kernel_idle_timeout: 1800, max_session_kernels: 4). One crumb for the team, not touched here: the comment at hermes_cli/config_defaults.py:1778 still says "remote backends run per-call", which tools/code_kernel_remote.py contradicts. Verified against main @ ee84ccd (2026-09-08); source read from the same SHA.

…spillover

The code-execution page describes project vs strict mode, the minimal environment and the RPC channel, but never mentions that execute_code calls share a persistent per-session kernel (tools/code_kernel.py), that a timeout kills the kernel, that reset=true exists, or that stdout beyond 50 KB is spilled to cache/exec with the path returned (tools/code_execution_tool.py). Defaults from hermes_cli/config_defaults.py (kernel_idle_timeout 1800, max_session_kernels 4). Remote-backend kernel and fail-open per-call fallback from tools/code_kernel_remote.py.
@alt-glitch alt-glitch added type/docs Documentation improvements P3 Low — cosmetic, nice to have tool/code-exec execute_code sandbox labels Sep 8, 2026
@Enough1122

Copy link
Copy Markdown
Contributor

AI code review — automated review for reference; please use your judgment.

Summary

Docs-only: documents the execute_code session kernel (persistent per-session interpreter), its end conditions (timeout/interrupt, reset=true, idle/eviction), per-cell security rebinding, remote-backend parity with standalone fallback, and head-and-tail stdout spillover to ~/.hermes/cache/exec/.

Findings (all Non-blocking)

  • website/docs/user-guide/features/code-execution.md:10 — stdout row updated from "truncated with notice" to head-and-tail + saved-full-output, consistent with the new Large-output paragraph at line 39. Non-blocking.
  • Lines 20-37 cover kernel lifetime, env-freeze-until-reset, idle (1800s) and cap (4, oldest evicted) knobs with a config sample. Precise and actionable. Non-blocking.
  • Non-blocking check: verify the config keys (code_execution.kernel_idle_timeout, max_session_kernels) and the reset param name match the implementation exactly.

Verdict

Looks good — clear kernel contract docs.

@kshitijk4poor
kshitijk4poor enabled auto-merge (rebase) September 8, 2026 13:28
@kshitijk4poor
kshitijk4poor merged commit 0268b70 into NousResearch:main Sep 8, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/code-exec execute_code sandbox type/docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants