OpenClaw's agent file-reading path gained a useful reliability upgrade this morning. PR #126587, "fix(agents): read oversized single-line files without exec," changes how the canonical read owner handles minified JSON, generated data, and other files where one line can exceed the old 50 KiB line limit.
Before this fix, an agent reading a single oversized line could receive none of that line. The tool response recommended a Bash pipeline instead, which was a dead end on surfaces where the agent intentionally did not have exec or process access.
That created an awkward failure mode: the file was readable in principle, but the only suggested continuation path required a tool the agent might not be allowed to use.
The New Cursor Contract
The read owner now returns a bounded slice of the oversized line and includes a flat intra-line cursor. Existing line paging with offset and limit remains unchanged, so ordinary multi-line files keep the same behavior.
For large single-line files, the new behavior is more direct:
- Return a UTF-8 and UTF-16 safe slice.
- Stay within the model-visible output budget.
- Include continuation guidance that does not require shell access.
- Let repeated cursor reads reconstruct the original content exactly.
OpenClaw's adaptive wrapper chooses a context-derived byte budget and aggregates canonical pages without exceeding the complete visible cap. That matters for generated artifacts, lockfiles, telemetry dumps, packed JSON, and other common files where line boundaries are not human-friendly.
Skill Instructions Stay Whole
The PR also draws a clear boundary around skill and playbook-style instruction documents. Known skill instruction paths remain whole-document-only: window parameters are rejected, fitting instructions are delivered in full, and oversized instructions produce a bounded refusal instead of a partial first window.
That is the right tradeoff. A partial source file can be useful when the tool says how to continue. A partial instruction document is more dangerous because it can look like complete guidance while omitting critical constraints.
Why This Matters
This is not a flashy feature, but it improves a common agent workflow. Agents often need to inspect files created by other tools, package managers, exporters, or AI systems. Those files are not always formatted for humans. When the only available read tool refuses a long line and points at Bash, an exec-disabled environment becomes needlessly blind.
The fix keeps the read capability self-contained. Agents can now inspect large one-line content through read alone, including on constrained surfaces.
Verification Notes
The PR says the focused tests passed across read tooling, OpenClaw coding tools, and filesystem output contracts. It also reports direct assembled-tool proof with exec and process absent: an 81,936-byte minified JSON file was reconstructed in three bounded reads, and a 98,316-byte emoji line was reconstructed in four.
For users, the practical result is simple: OpenClaw should be better at reading the weird files agents actually encounter.