Skip to content

[WRONG BRANCH] fix(desktop): bound library reads and preflight write sizes - #730

Draft
luvs01 wants to merge 8 commits into
codex/fix-desktop-library-regular-reads-20261012from
devin/split719-desktop-byte-bound-20261012
Draft

luvs01 wants to merge 8 commits into
codex/fix-desktop-library-regular-reads-20261012from
devin/split719-desktop-byte-bound-20261012

Conversation

@luvs01

@luvs01 luvs01 commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Bound Desktop library reads and generated writes while retaining the verified regular-file reader from #718.

  • Limit profile and _meta.json reads to 4 MiB through the opened descriptor, preserving identity and change-time checks. Connection-owned stores retain their tighter limits.
  • Start allocation near the observed file size and grow within the byte bound, including when the file grows during the read.
  • Preflight generated sizes before replacement, backup creation, pivot, or deletion, so a refusal preserves existing bytes.
  • Use verified reads for picker profiles and library snapshots; extend the profile, removal, and growth regressions.

This is a stacked child of #718, targeting codex/fix-desktop-library-regular-reads-20261012. Parent validation and landing remain prerequisites to independent upstream submission.

Verification

Current head: 996942041f3c644a67c741f26b6630c306708269.

  • Current-head aggregate CI passed.
  • Relevant coverage is in tests/claude-integration/claude-desktop-picker-profile.test.ts, tests/clients/desktop-3p-removal.test.ts, and tests/clients/desktop-3p.test.ts.
  • The local profile-path attempts encountered configuration-mutation-lock stalls, including on the unchanged baseline. Those attempts are not passing evidence; the hosted result above supplies current-head platform validation.
  • Review-thread inspection found no unresolved findings or outstanding change requests.

Checklist

  • Reader and writer bounds agree.
  • The parent dependency and submission order are explicit.
  • Regression coverage, documentation, and current-head CI evidence are recorded.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Summary by CodeRabbit

  • Bug Fixes

    • Desktop profile and metadata files are limited to 4 MiB. Oversized output is refused before existing files are replaced or profiles are removed.
    • Reads now reject files that exceed the limit or change during reading, rather than risking truncated or unsafe data.
  • Documentation

    • Updated the Claude Desktop guide to explain file limits and how oversized output is handled.

Complete the Desktop byte-bound portion of PR #719 on top of PR #718, preserving identity checks and existing bytes on size refusals.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4f32344d-f313-48e7-817b-6a015830e529
📥 Commits

Reviewing files that changed from the base of the PR and between 8aedd75 and 9969420.

📒 Files selected for processing (9)
  • docs-site/src/content/docs/guides/claude-code.md
  • src/claude/desktop-3p-library.ts
  • src/claude/desktop-3p.ts
  • src/claude/desktop-picker-profile.ts
  • src/claude/desktop-remote-store-io.ts
  • structure/clients/claude-desktop.md
  • tests/claude-integration/claude-desktop-picker-profile.test.ts
  • tests/clients/desktop-3p-removal.test.ts
  • tests/clients/desktop-3p.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Desktop library reads and generated JSON writes now use a 4 MiB limit. Reads are bounded and detect growth or path replacement. Profile and metadata updates validate serialized output before replacement or cleanup. Tests cover boundary sizes and preservation of existing files.

Changes: Desktop library size limits

Layer / File(s) Summary
Shared size limit and bounded reads
src/claude/desktop-3p-library.ts, src/claude/desktop-remote-store-io.ts, structure/clients/claude-desktop.md, tests/clients/desktop-3p-removal.test.ts
The shared reader accepts a bounded byte limit, reads in chunks, rejects oversized or growing files, and checks path identity after reading. StoreIO.read caps its requested limit at 4 MiB. Tests cover the exact limit, growth during reading, and path removal.
Preflighted profile and metadata updates
src/claude/desktop-3p-library.ts, src/claude/desktop-3p.ts, src/claude/desktop-picker-profile.ts, structure/clients/claude-desktop.md, docs-site/src/content/docs/guides/claude-code.md, tests/clients/desktop-3p.test.ts, tests/claude-integration/claude-desktop-picker-profile.test.ts
Generated JSON is serialized and checked against the 4 MiB limit before writes. Removal paths prepare metadata before profile cleanup. Tests verify that oversized output does not replace existing files or create profile backups or state files.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Suggested reviewers: lidge-jun

Merge Risk: ⚪ Minimal · up to 99694

No actionable issue remains from this review; the change is mergeable after normal checks.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 7 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: bounding Desktop library reads and preflighting write sizes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 7 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@luvs01

luvs01 commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

No description provided.

@github-actions github-actions Bot added the bug Something isn't working label Oct 13, 2026
@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

luvs01 and others added 2 commits October 13, 2026 11:33
The merged regular-file contract paragraph carried 602 lines on the pushed
head; reflow keeps every guarantee — verified reader, POSIX no-follow and
identity checks, errno mapping, size cap and preflight — at exactly 600.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@luvs01
luvs01 marked this pull request as ready for review October 13, 2026 03:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T03:58:24.709615Z 2cbf5ee Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cbf5ee65a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/claude/desktop-picker-profile.ts
Comment thread src/claude/desktop-3p-library.ts Outdated
luvs01 and others added 2 commits October 13, 2026 13:34
# Conflicts:
#	structure/clients/claude-desktop.md
#	tests/claude-integration/claude-desktop-picker-profile.test.ts
…entally

Merge the picker-profile verified-reader migration, then stop
preallocating maxBytes+1 per read: allocate the observed size plus one
sentinel byte and grow within the bound when a file expands after
descriptor validation, preserving desktop_config_too_large for the
grown case.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@luvs01

luvs01 commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions Bot changed the title fix(desktop): bound library reads and preflight write sizes [WRONG BRANCH] fix(desktop): bound library reads and preflight write sizes Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (codex/fix-desktop-library-regular-reads-20261012); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft October 13, 2026 08:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant