Skip to content

feat(minimald): RPC to stream files to session homedir - #862

Closed
twitchyliquid64 wants to merge 1 commit into
mainfrom
tom/session-inner
Closed

feat(minimald): RPC to stream files to session homedir#862
twitchyliquid64 wants to merge 1 commit into
mainfrom
tom/session-inner

Conversation

@twitchyliquid64

@twitchyliquid64 twitchyliquid64 commented Jul 21, 2026

Copy link
Copy Markdown
Member

Not sure if needed in your loadouts work, but thought i would throw it together in case and you can merge in your morning if so

Summary by CodeRabbit

  • New Features
    • Added an SSH streaming capability to upload compressed “homedir files” (tar.zst) into an active session.
    • Uploaded archives are unpacked into the session’s home directory.
  • Bug Fixes
    • Improved reporting of unpacking failures with clearer daemon-provided error details.
  • Tests
    • Added coverage to verify streamed homedir archives unpack correctly into the expected paths.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3dfba4f9-ad2a-4c5f-96a7-3acf80eab8b6

📥 Commits

Reviewing files that changed from the base of the PR and between 116600c and 03945ab.

📒 Files selected for processing (2)
  • crates/minimal/src/client.rs
  • crates/minimald/src/rpc.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/minimal/src/client.rs
  • crates/minimald/src/rpc.rs

📝 Walkthrough

Walkthrough

Adds client support for streaming zstd-compressed home-directory archives over SSH and daemon support for routing, unpacking, and testing the new homedir subsystem.

Changes

Homedir file streaming

Layer / File(s) Summary
Daemon homedir subsystem and extraction
crates/minimald/src/rpc.rs
The daemon recognizes and dispatches STREAM_HOMEDIR_FILES, shares archive unpacking between workspace and homedir targets, selects paths.home, and tests extraction into the session home.
Client homedir upload flow
crates/minimal/src/client.rs
Client::upload_home_files configures the SSH session, streams the tar.zst archive, waits for closure, and reports daemon unpack errors.

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

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant SSH as SSH session channel
  participant Daemon as minimald RPC
  participant Home as Session home
  Client->>SSH: Request HomedirFilesTarZst
  SSH->>Daemon: Stream tar.zst archive
  Daemon->>Home: Unpack files
  Daemon-->>SSH: Return unpack errors via ExtendedData
  SSH-->>Client: Close channel
Loading

Possibly related PRs

  • gominimal/minimal#806: Uses the same SSH channel-close and ExtendedData unpack-error handling pattern for workspace uploads.

Suggested reviewers: evanspearman

Poem

I’m a rabbit with files in a neat little stream,
Zstd in my basket, packed like a dream.
Through SSH I hop, to the home path I go,
The daemon unpacks each file in a row.
If errors arise, extended data will show!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is far too vague and does not follow the required template sections for summary, testing, or checklist. Add the required Summary, Testing, and Checklist sections, and briefly explain what changed, why, and how it was verified.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, conventional, and accurately summarizes the new homedir file-streaming RPC.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/minimal/src/client.rs`:
- Around line 251-255: Update the error context on the channel_open_session call
in the homedir file upload method to identify homedir file upload rather than
workspace file upload. Preserve the existing await and error propagation
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 981d20d4-4e4a-41c5-a480-0e9ef6bf021b

📥 Commits

Reviewing files that changed from the base of the PR and between 4bfdcb0 and 116600c.

📒 Files selected for processing (2)
  • crates/minimal/src/client.rs
  • crates/minimald/src/rpc.rs

Comment on lines +251 to +255
let mut channel = self
.handle
.channel_open_session()
.await
.context("open channel for workspace file upload")?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the upload error context.

Line 255 reports a workspace upload when this method uploads homedir files, which misleads users during channel-open failures.

Proposed fix
-            .context("open channel for workspace file upload")?;
+            .context("open channel for homedir file upload")?;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let mut channel = self
.handle
.channel_open_session()
.await
.context("open channel for workspace file upload")?;
let mut channel = self
.handle
.channel_open_session()
.await
.context("open channel for homedir file upload")?;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/minimal/src/client.rs` around lines 251 - 255, Update the error
context on the channel_open_session call in the homedir file upload method to
identify homedir file upload rather than workspace file upload. Preserve the
existing await and error propagation behavior.

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.

2 participants