Skip to content

fix(quick-dev): use absolute paths in code -r invocations#2087

Merged
alexeyv merged 3 commits intomainfrom
fix-code-r-absolute-paths
Mar 21, 2026
Merged

fix(quick-dev): use absolute paths in code -r invocations#2087
alexeyv merged 3 commits intomainfrom
fix-code-r-absolute-paths

Conversation

@alexeyv
Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv commented Mar 21, 2026

Summary

  • code -r in step-05-present.md and step-oneshot.md now resolves absolute paths via git rev-parse --show-toplevel before invocation
  • Fixes silent failures when the agent's CWD differs from the project root (e.g., worktree setups)
  • Closes HIGH deferred finding from quick-dev path clickability fix (2026-03-21)

Test plan

  • Run quick-dev one-shot flow from a worktree — verify code -r opens the correct VS Code workspace
  • Run quick-dev plan-code-review flow — verify spec file opens in VS Code after commit
  • Verify paths are absolute in the code -r command output

Agent CWD may differ from the project root in worktree setups,
causing relative paths to silently fail. Resolve paths via
git rev-parse --show-toplevel before invoking code -r.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6dddcde4-6ef8-4574-8967-d8d212ee4c2d

📥 Commits

Reviewing files that changed from the base of the PR and between ad9cb7a and b989ec0.

📒 Files selected for processing (2)
  • src/bmm-skills/4-implementation/bmad-quick-dev/step-05-present.md
  • src/bmm-skills/4-implementation/bmad-quick-dev/step-oneshot.md

📝 Walkthrough

Walkthrough

The PR updates two documentation files to refine VS Code editor-launch behavior. Instructions now compute absolute paths for the repository root and spec file via git rev-parse --show-toplevel, then invoke code -r with both double-quoted absolute paths instead of relative paths for improved reliability.

Changes

Cohort / File(s) Summary
Editor-launch path handling
src/bmm-skills/.../step-05-present.md, src/bmm-skills/.../step-oneshot.md
Updated VS Code invocation to compute absolute repository root and spec file paths via git rev-parse --show-toplevel, pass both paths (double-quoted) to code -r, and retain graceful fallback when code is unavailable.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • PR #2039: Added the initial code -r {spec_file} editor-open behavior that this PR builds upon by refining path handling.
  • PR #2044: Also modifies the Present step's editor-launch behavior, updating the code -r invocation structure.
  • PR #2049: Updates step-05 present behavior around file path handling and editor-opening semantics.

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: fixing code -r invocations to use absolute paths instead of relative ones.
Description check ✅ Passed The description is well-related to the changeset, explaining the rationale for the fix, the specific files affected, and providing a test plan that aligns with the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-code-r-absolute-paths

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.

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 21, 2026

🤖 Augment PR Summary

Summary: Updates quick-dev presentation steps so code -r opens the correct workspace and target files using absolute repo/worktree paths.
Why: Avoids silent failures when the agent’s CWD isn’t the project root (e.g., worktree setups) by resolving the top-level via git rev-parse --show-toplevel.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

alexeyv added 2 commits March 21, 2026 12:22
Adds graceful fallback to current working directory when
git rev-parse --show-toplevel fails (VCS unavailable).
@alexeyv
Copy link
Copy Markdown
Collaborator Author

alexeyv commented Mar 21, 2026

Triage Summary

2 findings — FIX: 1, DISMISS: 1, DEFER: 0

# Severity Finding Decision
F1 MEDIUM Missing graceful fallback when git rev-parse --show-toplevel fails FIX — Added CWD fallback in both step-oneshot.md and step-05-present.md
F2 MEDIUM {absolute-spec-file} may resolve relative to CWD instead of {absolute-root} DISMISS{absolute-spec-file} is already absolute by construction; false positive

@alexeyv alexeyv merged commit 10282a4 into main Mar 21, 2026
5 checks passed
@alexeyv alexeyv deleted the fix-code-r-absolute-paths branch March 21, 2026 21:37
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