Skip to content

fix(sftp): treat stat-less SCP remotes as unknown size instead of failing upload - #3402

Merged
binaricat merged 4 commits into
mainfrom
ai/issue-3399-34954974050
Sep 18, 2026
Merged

binaricat merged 4 commits into
mainfrom
ai/issue-3399-34954974050

Conversation

@netcatty-bot

@netcatty-bot netcatty-bot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

When an SCP-only endpoint cannot run either supported stat command, Netcatty previously treated an unknown file size as zero. A nonempty staged upload then failed size verification and its stage was removed before the destination was published. This explains how this software defect can produce both the reported mismatch and an absent target file. The reporter's exact device/tool availability has not been established, so this is a proven reproduction of the defect, not confirmation of that device's configuration.

Unknown sizes now remain unknown for backend verification. A numeric placeholder plus sizeKnown: false preserves the renderer contract without allowing skip-unchanged or resume checks to mistake it for a real empty file. Real zero-byte sizes remain valid.

Type of Change

  • Bug fix
  • New feature
  • Refactor / code cleanup
  • Documentation update
  • Build / CI change
  • Other (please describe):

Related Issue (optional)

Closes #3399

Changes Made

  • Return unknown size when both SCP-shell stat variants fail.
  • Preserve numeric renderer results and explicitly mark unknown sizes.
  • Disable unchanged-file skipping when fresh size metadata is unavailable.
  • Preserve saved download progress and planned sizes when resuming an unknown-size source.
  • Cover parsing, bridge output, staged upload, and resume behavior.

Screenshots / Demo

No visual layout changes. Local reproduction used the shipped SCP backend and upload transaction with real OpenSSH scp -t, real shell commands, and real disk files. A shell function made stat unavailable; GNU chmod supplied Linux-compatible command behavior on the macOS test host. Before-change size semantics reproduced expected 17000 bytes, got 0 and an absent destination. Current behavior successfully created and replaced files with byte-identical contents and uploaded an empty file. This validates the local protocol/filesystem path, not a remote SSH connection or the reporter's hardware.

Testing

  • I have tested these changes locally (npm run dev)
  • Linting passes (npm run lint)
  • Tests pass (npm test)
  • Generated capability tool specs are updated when applicable (npm run generate:capability-tools)
  • No new console errors or warnings, if this affects app behavior

The focused run completed 360 tests: 358 passed and two timing assertions failed. These tests cover the SCP backend/protocol/session operations, fallback, file operations, staged upload, transfer bridge, dedicated resume, and transfer history. Two wall-clock performance assertions initially exceeded their thresholds during parallel execution; the affected resume/history suites passed all 59 tests when rerun sequentially. Full-suite and platform-build evidence is provided by the successful checks on commit 2218c252c23384e7b75f0c33c5ed57d6653f0079; the full suite was not rerun locally. No capability catalog change applies.

Two independent read-only reviewers returned CLEAN on that same commit. No additional source changes were needed in this review pass.

Checklist

  • My code follows the existing project style
  • I have added or updated relevant documentation
  • I have not introduced any breaking changes (or I have described them above)

@netcatty-bot netcatty-bot added automation:bot-pr PR created or owned by Cursor automation automation:codex-loop Own/bot PR waiting on Codex review↔fix loop triage Touched by Cursor automation labels Sep 15, 2026
@binaricat

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 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-09-15T11:38:22.970750Z 2218c25 Manual request
ℹ️ 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: 86393cd4e8

ℹ️ 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 electron/bridges/sftpBridge/scpShell.cjs
@binaricat

Copy link
Copy Markdown
Owner

@codex review

Repository owner deleted a comment from binaricat Sep 15, 2026

@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: 847a377f2a

ℹ️ 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 electron/bridges/sftpBridge/fileOps.cjs Outdated
@binaricat

Copy link
Copy Markdown
Owner

@codex review

Repository owner deleted a comment from binaricat Sep 15, 2026

@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: 718ece9a45

ℹ️ 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 electron/bridges/sftpBridge/fileOps.cjs
@binaricat

Copy link
Copy Markdown
Owner

@codex review

Repository owner deleted a comment from binaricat Sep 15, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 2218c252c2

ℹ️ 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".

@netcatty-bot
netcatty-bot marked this pull request as ready for review September 15, 2026 11:38
@netcatty-bot netcatty-bot added automation:codex-clean Last Codex review reported clean and removed automation:codex-loop Own/bot PR waiting on Codex review↔fix loop labels Sep 15, 2026
@netcatty-bot

Copy link
Copy Markdown
Collaborator Author

Codex reported no major issues. This PR is marked ready for human review/merge.

@binaricat
binaricat merged commit 0fa0c6a into main Sep 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean triage Touched by Cursor automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 在不支持SFTP的设备中,使用scp上传会失败

2 participants