Skip to content

[Automated] Draft docs (kagent): feat(sandbox): read_sandbox_file returns text pages and images - #600

Merged
Rachael-Graham merged 2 commits into
mainfrom
pr-tracker-draft-kagent-3120
Oct 14, 2026
Merged

Rachael-Graham merged 2 commits into
mainfrom
pr-tracker-draft-kagent-3120

Conversation

@github-actions

Copy link
Copy Markdown

kagent-dev/kagent#3120 — feat(sandbox): read_sandbox_file returns text pages and images

Docs versions: 1.x (first shipped in v1.0.0-alpha12)

What changes for users: The sandbox MCP read_sandbox_file tool now returns content that a model can read directly instead of data_base64. Text returns as numbered, paged lines; PNG, JPEG, and GIF files up to 10 MiB return as images; other file types return a description.

What the docs now say: The Standalone sandboxes page now separates read_sandbox_file from the base64 transfer tools. Readers learn that write_sandbox_file and read_sandbox_outputs still use base64, while read_sandbox_file uses offset and limit for text paging and returns images directly.

Not verified: No cluster was configured, so the MCP calls are unrun.

How kagent-3120 was drafted, and what was not verified

Plan, and what changed it

  • Planned: Update the code-path target, Your first MCP tool, with the changed sandbox MCP file-read behavior.
  • Learned: A docs checkout search found the stale transfer-limit claim on docs-site/content/kagent/1.x/about/substrate-runtime/standalone-sandboxes.md, and the code-path target does not describe sandbox file reads.
  • Did: Updated the Standalone sandboxes page and wrote a proposed release note.

Why a documentation change is necessary

The pull request changes the user-visible result shape of read_sandbox_file: the tool no longer returns data_base64, and it can return text pages or image content directly. The existing Standalone sandboxes page said every MCP transfer or output read was base64, bounded at 1 MiB, and offset-based. That statement is now wrong for read_sandbox_file, so a reader building or debugging an agent would expect the old structured result.

What changed on disk

  • docs-site/content/kagent/1.x/about/substrate-runtime/standalone-sandboxes.md: Corrects the MCP transfer-limit paragraph and documents the current read_sandbox_file result shapes.

How to verify this change

  1. Stand up a kagent upstream 1.x cluster, install the sandbox guest image values from the Standalone sandboxes guide, and create a Sandbox.
  2. Bind the kagent-api RemoteMCPServer to an AgentTemplate with the sandbox file tools, then have the agent call read_sandbox_file for a text file in the Sandbox.
  3. The tool result should contain numbered lines, such as 1\tfrom MCP, instead of a data_base64 field. Reading a PNG, JPEG, or GIF file that is at most 10 MiB should return an image attachment.
How the pages were chosen (triage report)

Draft a documentation change

kagent-dev/kagent#3120 — feat(sandbox): read_sandbox_file returns text pages and images

  • Product: kagent (upstream) → kagent-dev/website
  • Docs version: 1.x
  • Summary (read from the body): read_sandbox_file returns base64, which models can only read by decoding it as output tokens. It now behaves like Claude Code's native Read tool:
  • Not tested: no cluster was available, so every command in this diff is unrun
  • No rule covers 4 touched file(s). The candidate pages below come from the files that DID match a rule, so they may scope this narrower than the change is. Read these before deciding the change is only about the pages listed:
    • .claude/skills/kagent/references/sandboxes.md
    • docs/architecture/sandboxes.md
    • go/harness/claude/config/config.go
    • go/harness/codex/config/config.go

Warnings

Draft branch: pr-tracker-draft-kagent-3120


Important

The test suite has not run on this pull request. It was opened by github-actions[bot], and GitHub does not start workflows for pull requests opened with the repository's own token. This repository's checks are held as action_required until somebody presses Approve and run on the Checks tab. Checks that come from GitHub Apps rather than Actions, such as DCO, run on their own.

Please approve the checks before reviewing the content: an absence of failures here means the tests have not run, not that they passed.

actions-user and others added 2 commits October 14, 2026 10:29
…urns text pages and images

Signed-off-by: GitHub Action <action@github.com>
Verified every number against the merged kagent#3120:
maxSandboxPageBytes, maxSandboxImageBytes, defaultSandboxReadLines, and
maxSandboxLineBytes in go/core/internal/mcp/sandboxes.go. The draft's
figures were right; its precision and coverage were not.

- A page holds at most 2000 lines, not exactly 2000. The draft read as
  wrong for any file shorter than a page.
- "A line longer than 2000 bytes is cut" left the reader unable to tell
  a dropped line from a truncated one. The code truncates to 2000 bytes
  and appends a [line cut] marker.
- Paging was undocumented where it matters: offset is a 1-based line
  number, and a short page reports the offset to continue from. Naming
  offset and limit without either fact does not let a reader page.
- An image over 10 MiB returns a message asking for a smaller copy. The
  draft's "other file types return a description" did not cover it.
- Condition before command, per ste.md: the trailing "when" clause moves
  to the front of the sentence.
- Dropped the "Unlike write_sandbox_file and read_sandbox_outputs"
  clause, which restated the contrast the preceding paragraph drew.
- Split the seven-sentence block into three paragraphs, one per result
  shape.

Added the three file tools to the tool-binding example above, which
listed only lifecycle tools and so named none of the tools this section
discusses.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Rachael Graham <rachael.graham@solo.io>
@github-actions

Copy link
Copy Markdown
Author

Docs preview

Link Points at
Branch preview The newest push to this branch. Updates in place.
Commit preview c45bd36 only. Frozen.

Both are uploaded Worker versions and serve no production traffic.

@Rachael-Graham
Rachael-Graham merged commit 9a7697f into main Oct 14, 2026
4 checks passed
@Rachael-Graham
Rachael-Graham deleted the pr-tracker-draft-kagent-3120 branch October 14, 2026 15:22
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.

2 participants