Skip to content

fix(read-text): align read limits, guidance, and output previews - #63

Merged
locez merged 1 commit into
mainfrom
fix/read-text-output-and-guidance
Sep 20, 2026
Merged

locez merged 1 commit into
mainfrom
fix/read-text-output-and-guidance

Conversation

@locez

@locez locez commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Make successful read_text output honor show_successful_command_output in both live sessions and transcript replay, without hiding failure diagnostics or changing runtime artifacts/model-visible results.
  • Reuse one CLI preview and render-time visibility path for reads and processes. Retain at most five nonempty lines of 180 Unicode scalar values each, preserving character, line, and upstream truncation indicators.
  • Raise the default/max read window from 200 to 2,000 lines while keeping the independent 1 MiB scan/return limit.
  • Consolidate read scope and content-reuse strategy in the stable coding policy: focused reads when sufficient, larger or whole-file reads when required, and no unnecessary re-reading of unchanged context.
  • Let unspecified Python workspace limits inherit Rust defaults instead of duplicating numeric defaults in Python.
  • Consolidate read-specific TUI tests and add end-to-end Python tests for all four native limits, partial overrides, exact boundaries, invalid values, and failure without file mutation.

Boundaries and compatibility

  • Preview limits are CLI-only; the 2,000-line tool window and retained artifacts are independent of presentation truncation.
  • WorkspaceLimits fields now remain None when inherited. Explicit positive values still override individual Rust defaults; Python configuration is not a resolved-default snapshot. SDK documentation and native type stubs are updated.
  • The coding prompt, read tool description, and default schema change the request prefix across versions. The new prefix and tool order remain stable within a session; this does not introduce per-turn prompt/tool churn.
  • No new crate, runtime state owner, or provider protocol is introduced. The read-result DTO remains unchanged.

Verification

  • git diff --check
  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all — 2,219 passed, 9 ignored
  • Python uv sync and maturin develop --uv --features test-utils
  • Ruff format/check and ty check — zero diagnostics
  • Python pytest tests -q — 78 passed
  • uv build — source distribution and wheel built successfully

Long-line preview regression tests fail before the preview bound is restored and pass afterward. Python limit tests use a local deterministic model fixture and execute the actual Rust workspace tools. No live-model comparison is claimed for the prompt's behavioral effects. Packaging still reports existing Cargo manifest metadata warnings.

Avoid unnecessary small read windows and repeated reads while keeping
successful file output subject to the configured TUI display policy.

- Raise the default and maximum read window to 2,000 lines while retaining
  the independent 1 MiB scan/return limit.
- Consolidate task-sized read and content-reuse guidance in the stable
  coding policy; keep tool mechanics in the tool description.
- Share render-time preview visibility and truncation for process and file
  output, bounding previews to five lines of 180 Unicode scalars each.
- Let unset Python workspace limits inherit Rust defaults through Option
  values; preserve explicit overrides and document the None-valued fields.
- Cover live/replayed output, failure visibility, long UTF-8 lines, native
  limit enforcement, invalid limits, and failure-before-write behavior.

Verification: cargo fmt --all --check; cargo clippy --all-targets
--all-features -- -D warnings; cargo test --all (2,219 passed, 9 ignored).
Python: uv sync, native test-utils build, Ruff format/check, ty check,
pytest (78 passed), and uv build. git diff --check passed.

Prompt, tool-description, and default-schema changes affect cross-version
prefix reuse; instructions and tool order remain stable within a session.
@locez
locez merged commit 02b6442 into main Sep 20, 2026
6 of 8 checks passed
@locez
locez deleted the fix/read-text-output-and-guidance branch September 20, 2026 15:06
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.

1 participant