Repository navigation
fix: avoid snapshot diff next steps - #158
Conversation
📝 WalkthroughWalkthroughThe PR adds workspace-source-aware capability gating to remote session result commands. When a one-shot remote session completes, the cleanup code now checks whether the workspace is Git-backed and conditionally displays the ChangesGit-backed capability gating for remote diff/patch commands
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
coding-agent/tests/cli/test_remote_client.py (1)
1873-1983: ⚡ Quick winAdd assertions for diff/patch commands in Git-backed session test.
The test
test_remote_run_clean_git_repo_uses_git_workspace_sourceverifies Git-backed sessions show the publish command but doesn't verify that diff and patch commands also appear. Since both capabilities use the samehas_git_workspace_sourceflag, they should be tested together.🧪 Recommended test assertions to add
Add these assertions after line 1960:
assert ( "coding_agent remote publish dev --session sess-git --branch coding-agent/session-sess-git" in result.output ) + assert "coding_agent remote diff dev --session sess-git" in result.output + assert "coding_agent remote patch dev --session sess-git" in result.output assert calls == [🤖 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 `@coding-agent/tests/cli/test_remote_client.py` around lines 1873 - 1983, The test test_remote_run_clean_git_repo_uses_git_workspace_source currently asserts the publish command is printed but misses verifying the diff and patch publish commands; update this test to also assert that the diff and patch command strings containing the session id "sess-git" and branch "coding-agent/session-sess-git" are present in result.output. After the existing publish assertion in test_remote_run_clean_git_repo_uses_git_workspace_source, add assertions that result.output includes the diff command and the patch command (both using --session sess-git and --branch coding-agent/session-sess-git) so diff/patch are validated alongside publish.
🤖 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.
Nitpick comments:
In `@coding-agent/tests/cli/test_remote_client.py`:
- Around line 1873-1983: The test
test_remote_run_clean_git_repo_uses_git_workspace_source currently asserts the
publish command is printed but misses verifying the diff and patch publish
commands; update this test to also assert that the diff and patch command
strings containing the session id "sess-git" and branch
"coding-agent/session-sess-git" are present in result.output. After the existing
publish assertion in test_remote_run_clean_git_repo_uses_git_workspace_source,
add assertions that result.output includes the diff command and the patch
command (both using --session sess-git and --branch
coding-agent/session-sess-git) so diff/patch are validated alongside publish.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9d23ab81-209d-43fb-879b-1625d68653fb
📒 Files selected for processing (2)
coding-agent/src/coding_agent/__main__.pycoding-agent/tests/cli/test_remote_client.py
Summary
Dogfood context
A production-mode snapshot fallback dogfood run succeeded, but the post-run guidance still suggested remote diff/patch even though snapshot sessions cannot use those commands.
Validation
Summary by CodeRabbit