Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

refactor(init): simplify V2 file reads - #1450

Merged
betegon merged 2 commits into
mainfrom
refactor/init-read-files-v2-deterministic
Aug 21, 2026
Merged

betegon merged 2 commits into
mainfrom
refactor/init-read-files-v2-deterministic

Conversation

@betegon

@betegon betegon commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

Summary

read-files now has one exact V2 contract:

  • up to 20 canonical root-relative paths per call
  • up to 40,000 aggregate content bytes per call
  • stateless continuation with startLine
  • no V1 response mode, deterministic profile, maxBytes, maxLines, or model-owned budget knobs

The reader scans large prefixes incrementally without retaining them, keeps only the bounded result page, handles short reads and UTF-8 boundaries, and returns complete lines with explicit truncation.

Path handling is shared with startup pre-reads and rejects absolute paths, traversal, aliases, invalid portable path forms, duplicate canonical paths, unsafe symlinks, non-regular files, and TOCTOU changes. Tool cwd is resolved against the immutable selected root before every local operation, closing symlink-based cwd escapes.

This is the paired CLI rollout for getsentry/cli-init-api#244.

Rollout

Release this change as CLI 0.43.0 and verify that sentry cli upgrade serves it before deploying the strict API. The API accepts init protocol v1 only, requires CLI 0.43.0+, uses read-files V2 only, and gives older clients an explicit upgrade instruction.

Test plan

  • init plus safe-read suites: 36 files, 564 tests passed
  • CLI TypeScript: passed
  • full Biome: 989 files passed
  • git diff --check: passed
  • independent filesystem, sandbox, protocol, and scope reviews: clean
  • compiled 0.43.0-dev.0 binary completed a full local Next.js canary against the paired Workers
  • canary installed and verified @sentry/nextjs, then bun run build passed

Give deterministic workflow reads a larger bounded path and byte profile while keeping normal agent reads compact. This lets plan, recovery, and verification consume complete large files without weakening the shared sandbox.
@vercel

vercel Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 21, 2026 2:12pm

Request Review

@betegon betegon changed the title fix(init): support deterministic V2 file reads refactor(init): simplify V2 file reads Aug 21, 2026
@betegon
betegon marked this pull request as ready for review August 21, 2026 17:42
@betegon
betegon merged commit 8300222 into main Aug 21, 2026
33 checks passed
@betegon
betegon deleted the refactor/init-read-files-v2-deterministic branch August 21, 2026 17:50

This branch was successfully deployed

1 active deployment
Preview — d6a2f73f Deployed Aug 21, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant