Skip to content

feat: make remote run result-first - #148

Merged
delete-cloud merged 2 commits into
mainfrom
feat/remote-run-result-first
May 13, 2026
Merged

delete-cloud merged 2 commits into
mainfrom
feat/remote-run-result-first

Conversation

@delete-cloud

@delete-cloud delete-cloud commented May 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • make remote run leave the session open by default for result inspection
  • print next-step commands for diff, patch, archive download, and close
  • keep archive overwrite available through explicit remote run --download --yes
  • keep remote repl compatibility behavior unchanged

Validation

  • uv run pytest tests/cli/test_remote_client.py -k "remote_run or remote_repl_with_repo or remote_diff or remote_patch or download" -q
  • uv run basedpyright --level error src/coding_agent/__main__.py tests/cli/test_remote_client.py
  • uv run ruff format --check src/coding_agent/__main__.py tests/cli/test_remote_client.py
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Added --download flag to remote run for explicit workspace download and cleanup.
    • CLI now prints clear next-step commands (show diff, export patch, download archive, close session) when a session is left open.
  • Bug Fixes / Behavior

    • Remote sessions remain open by default for inspection; --yes confirmation now applies only when downloading.
  • Documentation

    • Clarified --repo help to state results stay remote unless --download is used.
  • Tests

    • Updated and added CLI tests to cover one-shot vs download behaviors.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7af03e33-1b03-41b4-89ab-00328bc38263

📥 Commits

Reviewing files that changed from the base of the PR and between 4fe635e and bc94a1f.

📒 Files selected for processing (2)
  • coding-agent/src/coding_agent/__main__.py
  • coding-agent/tests/cli/test_remote_client.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • coding-agent/tests/cli/test_remote_client.py
  • coding-agent/src/coding_agent/main.py

📝 Walkthrough

Walkthrough

remote run gained a --download flag and wiring so downloads/restores and session deletion are conditional; omitting --download leaves the remote session open and prints standardized next-step commands. remote repl calls reuse the same flow with cleanup forced.

Changes

Remote run download and cleanup control

Layer / File(s) Summary
CLI interface: --download flag and REPL wiring
coding-agent/src/coding_agent/__main__.py
Adds --download option, updates --repo/--yes help text, and makes remote repl call _remote_run_once with download/cleanup parameters.
Function signatures and parameter wiring
coding-agent/src/coding_agent/__main__.py
remote_run() adds download_results; _remote_run_once() adds download_results and cleanup_on_success; CLI passes values through.
Validation and conditional restore/cleanup
coding-agent/src/coding_agent/__main__.py
Enforces --download requires --repo; workspace restore/download only runs when repo_path and download_results are set; session deletion happens only when cleanup_on_success is true.
Result output and next-step inspection commands
coding-agent/src/coding_agent/__main__.py
Replaces inline next-step text with _print_remote_result_next_steps(...) to print diff/patch/download/close commands when auto-cleanup is skipped.
Test coverage for download and cleanup behavior
coding-agent/tests/cli/test_remote_client.py
Updated REPL/help and one-shot session tests; added tests for --repo without --download (session left open) and --repo --download --yes (full manifest/download/extract + cleanup).

Sequence Diagram(s)

sequenceDiagram
  participant CLI as "remote run / remote repl"
  participant Handler as "_remote_run_once"
  participant RemoteAPI as "Remote session API"
  participant LocalFS as "Local workspace (manifest/archive)"

  CLI->>Handler: start session (repo?, download_results, cleanup_on_success)
  Handler->>RemoteAPI: create session / run actions
  RemoteAPI-->>Handler: session id, result archive available
  Handler->>RemoteAPI: optionally GET /sessions/<id>/manifest (if download_results)
  RemoteAPI-->>Handler: manifest
  Handler->>RemoteAPI: optionally GET /sessions/<id>/archive (if download_results)
  RemoteAPI-->>Handler: archive
  Handler->>LocalFS: extract/apply archive (if download_results)
  Handler->>RemoteAPI: DELETE /sessions/<id> (if cleanup_on_success)
  Handler-->>CLI: print success + either cleanup message or next-step commands
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped to the cloud and found sessions that stay,

Peek, diff, patch—inspect without taking away.
Ask for a download and I’ll tidy the lair,
Else I’ll leave tracks and the next steps to share.
A rabbit-approved workflow, easy and fair.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 'feat: make remote run result-first' clearly and concisely describes the main change: shifting the remote run behavior to prioritize result inspection by leaving sessions open by default rather than auto-deleting them.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/remote-run-result-first

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 `@coding-agent/src/coding_agent/__main__.py`:
- Around line 527-530: The help text for the CLI flag "--repo" under the "remote
repl" command is incorrect (it claims results stay remote unless a non-existent
"--download" is passed) — update the help string in the argument definition (the
add_argument call that defines "--repo" in coding_agent.__main__.__main__ / CLI
setup) to accurately reflect actual behavior (that specifying --repo triggers
auto-download of results), or alternatively change the implementation in the
remote repl handler to match the help; reference the "--repo" add_argument and
the "remote repl" command handler where repo-upload/auto-download occurs and
make the help and behavior consistent.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c07c5db8-6b85-4d6d-ba41-b0d5522236b0

📥 Commits

Reviewing files that changed from the base of the PR and between 91b7a58 and 4fe635e.

📒 Files selected for processing (2)
  • coding-agent/src/coding_agent/__main__.py
  • coding-agent/tests/cli/test_remote_client.py

Comment thread coding-agent/src/coding_agent/__main__.py
@delete-cloud
delete-cloud merged commit 5caf9cb into main May 13, 2026
1 check passed
@delete-cloud
delete-cloud deleted the feat/remote-run-result-first branch May 13, 2026 09:15
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