Skip to content

🤖 fix: repair review paths for sub-projects - #3370

Merged
ammario merged 1 commit into
mainfrom
fix-review-subproject-paths
May 23, 2026
Merged

ammario merged 1 commit into
mainfrom
fix-review-subproject-paths

Conversation

@ammar-agent

@ammar-agent ammar-agent commented May 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes Review/Assisted Review path handling for sub-project workspaces by keeping repo-oriented review commands at the checkout root and keeping Review pins in project-relative coordinates.

Background

  • Sub-project workspaces intentionally run normal agent/tool commands from a scoped cwd. The Review pane, however, builds repo-root git pathspecs and renders project-relative diff paths, so running review git commands from the scoped cwd could make selected files or assisted pins disappear.
  • Agents also naturally call review_pane_update with paths like src/file.ts; those can be ambiguous between a project-relative path and a path relative to the current tool cwd.

Implementation

  • executeBash({ cwdMode: "repo-root" }) and git command mode now use the single-project checkout root while preserving default scoped execution cwd.
  • Assisted review now treats project-relative paths as canonical. Ambiguous plain paths keep their primary project-relative form, while Review diff fetching/matching can try an execution-root fallback only when the primary path has no matching hunk.
  • Explicit ./ and ../ tool paths resolve from the current tool cwd; root files like README.md and sibling paths like packages/shared.ts are not blindly prefixed.
  • Assisted dedupe keeps exact keys separate from fallback keys so root/scoped sibling pins can coexist; fallback refinement only matches entries that existed before the current update, avoiding order-dependent collapse within a single tool call.
  • New tool writes normalize explicit cwd-relative input at the backend boundary; ReviewPanel also resolves candidates when consuming stored/transcript pins so older cwd-relative pins self-heal without corrupting canonical paths.
  • Updated review tool docs/generated skill content to say paths are project-relative and .//../ should be used when cwd-relative resolution is required.

Validation

  • bun test src/common/utils/review/assistedReview.test.ts src/node/services/tools/review_pane.test.ts src/browser/features/RightSidebar/CodeReview/ReviewPanel.assistedStats.test.ts src/node/services/workspaceService.test.ts -t "executeBash workspace path resolution|project-relative path normalization|applyReviewPaneUpdate|normalizeReviewPanelAssistedHunks|countUnreadAssistedHunks|buildReviewDiffPathFilter|buildReviewDiffPathFilterSpecs"
  • make static-check

Risks

  • Low-to-moderate. The change touches shared review path resolution and executeBash cwd selection for repo-root/git command mode; tests cover default scoped cwd, repo-root cwd, canonical project-relative paths, execution-root fallbacks, assisted pin dedupe, and ReviewPanel matching.

Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $37.97

@mintlify

mintlify Bot commented May 23, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Mux 🟢 Ready View Preview May 23, 2026, 5:12 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

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

@ammar-agent
ammar-agent force-pushed the fix-review-subproject-paths branch from 137fede to 03b3f61 Compare May 23, 2026 20:32
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

I folded in the cleanup to make Review's canonical path contract project-relative instead of introducing sub-project-relative terminology.

@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: 03b3f615a8

ℹ️ 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 src/common/utils/review/assistedReview.ts Outdated
@ammar-agent
ammar-agent force-pushed the fix-review-subproject-paths branch from 03b3f61 to 73604b9 Compare May 23, 2026 20:46
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the path-candidate issue: project-relative paths remain canonical, ambiguous plain paths keep exact primary matching, and execution-root fallbacks are only used for fetching/fallback matching.

@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: 73604b9afe

ℹ️ 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 src/node/services/tools/review_pane.ts Outdated
@ammar-agent
ammar-agent force-pushed the fix-review-subproject-paths branch from 73604b9 to e67b616 Compare May 23, 2026 20:53
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the dedupe ordering issue by separating exact assisted keys from execution-root fallback keys, so exact canonical updates win before fallback matching.

@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: e67b6162ec

ℹ️ 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 src/node/services/tools/review_pane.ts
@ammar-agent
ammar-agent force-pushed the fix-review-subproject-paths branch from e67b616 to 3ffc7bd Compare May 23, 2026 21:03
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the fallback dedupe miss by checking fallback mappings for incoming exact canonical keys before appending, with a regression test for the duplicate case.

@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: 3ffc7bda35

ℹ️ 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 src/node/services/tools/review_pane.ts Outdated
@ammar-agent
ammar-agent force-pushed the fix-review-subproject-paths branch from 3ffc7bd to 873fdef Compare May 23, 2026 21:10
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Updated dedupe semantics to keep incoming exact canonical paths distinct from ambiguous fallback pins, while still allowing incoming ambiguous paths to refine an existing exact fallback target. This preserves both files when root and scoped paths can coexist.

@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: 873fdefa3f

ℹ️ 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 src/node/services/tools/review_pane.ts
Keep Review pins project-relative, use execution-root candidates for ambiguous tool input, and run repo-root review git commands at the checkout root.

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$37.97`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=37.97 -->
@ammar-agent
ammar-agent force-pushed the fix-review-subproject-paths branch from 873fdef to b4b081e Compare May 23, 2026 21:19
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the order-dependent fallback dedupe issue: fallback matching is now limited to entries that existed before the current update, so root/scoped sibling pins added in one call can coexist regardless of order.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

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

@ammario
ammario merged commit df33005 into main May 23, 2026
24 checks passed
@ammario
ammario deleted the fix-review-subproject-paths branch May 23, 2026 21:36
yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Sep 25, 2026
…on sets, assisted matchers, workflow transitions) (coder#4483)

## Summary

Removes four production exports that only tests called, from the
test-audit follow-up campaign (WS2, crosscutting candidates coder#1–coder#4).
Behavior-preserving: no production caller changes.

## Removed

| Symbol | Why it was dead | Tests |
| --- | --- | --- |
| `isCopilotRoutableModel` (`copilot/modelRouting.ts`) | Always returned
`true`; no caller since coder#3104 | 2 tests restating the constant deleted |
| `gatherInstructionSets` (`instructionFiles.ts`) | No caller since
coder#439; `systemMessage.ts` calls `readInstructionSet` directly | 4 tests
deleted; `readInstructionSet` tests already cover null, local files,
scope and `projectName` |
| `findAssistedMatch`, `hunkMatchesAssisted` (`assistedReview.ts`) |
Replaced by the `*Candidate*` versions in coder#3370; only tests called them
| Range overlap, deletion fallback (old-side span), rename (`oldPath`),
first-match index and no-match cases moved onto
`findAssistedCandidateMatch`, the function `ReviewPanel` calls.
`hunkMatchesAssistedCandidate` is now module-private |
| `WorkflowRunStatusTransitionSchema` + its table
(`orpc/schemas/workflow.ts`) | Never enforced; coder#4089 kept it only
because a test imported it. Real enforcement lives in
`WorkflowService`/`WorkflowRunStore` (tested in
`WorkflowRunStore.test.ts`) and follows different rules | "rejects
impossible status transitions" deleted |

## Validation

- Mutation check: disabling the deletion fallback and the `oldPath`
match in `hunkMatchesPathAndRange` fails the two moved tests.
- `bun test src/common/utils/review/ src/common/utils/copilot/
src/node/utils/main/instructionFiles.test.ts
src/common/orpc/schemas/workflow.test.ts
src/node/services/tools/review_pane.test.ts`
- `make static-check` on the stack top.

Stack: 1/5 (coder#4483 → coder#4484 → coder#4485 → coder#4486 → coder#4487).
---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high` • Cost: `$4.45`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high
costs=4.45 -->

This branch was successfully deployed

1 active deployment
staging - docs — b4b081e2 Deployed May 23, 2026 by mintlify[bot]
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