Skip to content

[codex] Fix PR worktree checkout materialization#4643

Merged
Kitenite merged 10 commits into
mainfrom
fix-pr-checkout-stash
May 17, 2026
Merged

[codex] Fix PR worktree checkout materialization#4643
Kitenite merged 10 commits into
mainfrom
fix-pr-checkout-stash

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented May 16, 2026

Summary

  • Replace the v2 PR workspace flow that created a detached placeholder worktree and then ran gh pr checkout.
  • Add a materialize-first helper that fetches and verifies the PR head against GitHub's headRefOid, creates/configures the local branch, then lets workspaces.create add the worktree from that branch.
  • Start materialized PR branches from verified commit OIDs, not mutable fetched refs; synthetic fallback fetches reuse one stable internal ref per PR.
  • Remove the now-unused gh pr checkout recovery helper/tests.
  • Configure cross-repo PR branches with a Superset-managed fork remote and push refspec so plain git push targets the contributor branch instead of refs/pull/<n>/head.
  • Return materialization warnings from workspaces.create and surface them in the desktop workspace-create flow.
  • Serialize concurrent creates for the same project/PR so repeated clicks reuse the first workspace instead of racing git worktree creation.
  • Normalize adopted local PR branches through the same tracking/push setup as freshly materialized branches, and roll back newly created PR branches if later workspace registration fails.
  • Update CLI/MCP/SDK/docs text so --pr no longer claims the host runs gh pr checkout.
  • Document the current setup, Worktrunk/T3Code comparison, implemented fix, and remaining follow-ups in plans/done/20260516-pr-worktree-checkout-flow.md.

Why

The old flow performed two checkouts in the target path. git worktree add --detach can run hooks, filters, or watchers that dirty tracked files such as package-lock.json; the later gh pr checkout --force can still fail with local changes would be overwritten by checkout.

The new flow avoids the dirty-placeholder state entirely: it materializes the verified branch first, then performs one worktree checkout.

Known follow-ups

  • v1 desktop still uses the old detached worktree + gh pr checkout path and should get a separate backport.
  • Add richer fork permission handling (maintainerCanModify, deleted forks, inaccessible forks) if exact GitHub CLI parity is needed for every fork push edge case.
  • Renderer surfacing for hook-induced dirty-status warnings is still deferred; materialization/setup warnings now reach the desktop flow.

Validation

  • bun test packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.test.ts packages/host-service/test/integration/workspace-create-pr.integration.test.ts packages/host-service/test/integration/pr-branch-materialize.integration.test.ts (21 pass, 0 fail)
  • bun test packages/host-service/test/integration (206 pass, 8 existing todos, 0 fail)
  • bun run --cwd packages/host-service test:e2e (12 pass, 0 fail)
  • bun run typecheck
  • bun run lint

Open in Stage

Summary by cubic

Fix PR workspace creation by materializing the verified PR head before creating the worktree. This removes the detached worktree + gh pr checkout flow, prevents “local changes would be overwritten by checkout” errors, and configures fork pushes for cross‑repo PRs.

  • Bug Fixes

    • Fetch and verify the PR head against headRefOid, create/configure the local branch, then run one git worktree add <path> <branch>.
    • Support same‑repo PRs via refs/heads/<branch> and cross‑repo or deleted head branches via refs/pull/<n>/head; abort on OID mismatch. For cross‑repo PRs with fork metadata, add a superset-pr-<n> remote and set pushRemote with HEAD:refs/heads/<headRefName>; warn when fork metadata is missing or when falling back to the synthetic PR ref.
    • Handle edge cases: normalize tracking for existing branches, detect conflicts, and abort with a clear error; on failure, delete only a newly created PR branch that still points at the verified head. Return warnings from the host; desktop now surfaces them as toasts.
  • Refactors

    • Added materializePrBranch, normalizePrBranchTracking, and cleanup utilities with unit/integration tests covering edge cases; workspaces.create now materializes the branch then runs git worktree add. fetchPrMetadata uses injected ctx.execGh; integration tests confirm the host never runs gh pr checkout in worktree mode.
    • Updated CLI/@mcp-v2/@superset/sdk/docs: --pr “checks out the verified PR head” and workspaces.create returns a warnings array. Added design doc plans/done/20260516-pr-worktree-checkout-flow.md. Removed the old gh pr checkout recovery helper and its tests.

Written for commit 143decc. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features

    • Server now materializes and checks out the verified PR head, derives the workspace branch, returns optional warnings, and serializes concurrent PR workspace creation.
  • Bug Fixes

    • Verifies PR head before adding worktrees to avoid dirty-file/checkout failures and improves safe rollback and conflict handling.
  • Documentation

    • Updated CLI, SDK, tooling and help text to reflect the new PR checkout behavior.
  • Tests

    • Added unit and integration tests for PR branch materialization and worktree flows; removed legacy checkout-recovery tests.
  • UI

    • Warnings from the server are surfaced to users via toast notifications.

Review Change Stack

@capy-ai
Copy link
Copy Markdown

capy-ai Bot commented May 16, 2026

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

<review_stack_artifact_start>
<stack_title>PR Worktree Materialization</stack_title>
<stack_summary>Replace detached worktree + gh pr checkout with PR branch materialization (fetch/verify/configure) then direct git worktree add; adds tests, integration wiring, docs, and warning plumbing.</stack_summary>

Adds PR branch materialization utilities, integrates them into workspace creation, covers behavior with unit and integration tests, and updates CLI/SDK/docs, desktop warnings, and planning docs. Defines PR branch types, synthetic/verified-ref helpers, OID resolution/verification, same-repo and synthetic fetch strategies, branch creation/configuration, safe-delete, and exports materializePrBranch / deleteMaterializedPrBranchIfSafe. range_939f80582a3c range_63305c6cef88 range_f8efb900a3be range_47ad63a5ea2d range_63a34aca2e2f range_a1f8fa31e451 range_59262bae7933 range_8fad53eec151 range_f84d6b574ca8 ```mermaid sequenceDiagram participant WorkspacesCreate participant FetchPrMetadata participant ExecGh participant MaterializePrBranch participant GitClient WorkspacesCreate->>FetchPrMetadata: request PR metadata (pr number) FetchPrMetadata->>ExecGh: gh pr view --json (headRefOid, headRepository, ...) ExecGh-->>FetchPrMetadata: PR metadata (headRefOid, headRepository) WorkspacesCreate->>MaterializePrBranch: materializePrBranch(pr metadata) MaterializePrBranch->>GitClient: fetch refs/heads/ or refs/pull//head -> verified ref GitClient-->>MaterializePrBranch: fetched ref OID MaterializePrBranch->>GitClient: rev-parse --verify ^{commit} GitClient-->>MaterializePrBranch: commit OID alt OID matches headRefOid MaterializePrBranch->>GitClient: create local branch, configure branch..remote/merge and pushRemote MaterializePrBranch-->>WorkspacesCreate: MaterializePrBranchResult (branch,startPoint,sourceKind,tracking,..) WorkspacesCreate->>GitClient: git worktree add else OID mismatch MaterializePrBranch-->>WorkspacesCreate: reject "did not match GitHub headRefOid" end ``` Mocks Git to assert fetch/create/configure sequences for same-repo and cross-repo PRs; tests deleteMaterializedPrBranchIfSafe, adoption, abort-on-OID-mismatch, concurrency/adoption, and rollback error reporting. range_37e6426dbd8a range_091a95094dce range_70b484b28878 range_9a2c4fadeb85 range_d58482a2b98b range_115646e0d6e9 range_fe4f41ebf030 range_aaab1ac8a3ee range_0882130f61aa range_7a1f70e560e7 Bun-based integration tests that create a bare remote and local repo, install a post-checkout hook that dirties tracked files, exercise old detached-flow failure and new materialize flow success, and test deleteMaterializedPrBranchIfSafe cleanup behavior. range_3cac2d34c345 range_0372b5907537 range_1f34cb997d11 range_cac156c618eb range_1b26ef006c61 Injects ExecGh into fetchPrMetadata, replaces detached worktree + gh pr checkout with materializePrBranch + git worktree add, adds per-PR locks, tracks attempted worktree add and rolls back on failure, accumulates warnings, and attempts safe branch deletion when needed. range_319b81513a0d range_7c49c3568769 range_03c887363b22 range_2b594664f9b2 range_18e68ab288ea range_53656e7ff20d Integration tests that stub execGh to allow only gh pr view, push PR head refs, run workspaces.create, assert pr checkout not called, verify persisted worktreePath, worktree HEAD, package-lock.json status, stale headRefOid failure, same-repo success/fallback, conflict path, and concurrency serialization. range_4b949fa0b73c range_b0b94d38d4e8 range_b3a7715edb57 range_84fffe11c856 range_dec9794a97be range_02cafd48485b range_41f819567762 range_506dca3e9a9b Update CLI option and command schema, CLI reference, MCP tool schema, SDK JSDoc, and skills docs to state the server checks out the verified PR head and derives the branch; extend workspaces.create response with warnings array and surface warnings to desktop. range_d9abf0a063ab range_b49bc10b46bc range_b64d656c3c21 range_5a991ceb76b4 range_9cc8e6822540 range_b6d4c5bb5fbd range_98172e24e06c Planning doc describing the materialize-first v2 flow, failure modes of detached placeholder + gh pr checkout, implementation breakdown, test plan, rollback constraints, and current implementation status with follow-ups. range_7f012be442c7 range_cd0413831b7a range_547293c2cb9f range_870a04b4daad range_658fb4ebc539 range_388be5c9e7b3 range_0cc5f0f2493e range_7a7f41957632 range_047e86c181b8 Adds toast wiring to surface server-side materialization warnings after workspace creation by iterating result.warnings and calling toast.warning for each. range_91e5db477922 range_a3ccc120f5cc
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed The title '[codex] Fix PR worktree checkout materialization' clearly summarizes the main change: fixing the PR worktree checkout flow by implementing materialization.
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.
Description check ✅ Passed The PR description comprehensively covers objectives, technical implementation, validation, and known follow-ups aligned with the template structure.

✏️ 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 fix-pr-checkout-stash

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.

@stage-review
Copy link
Copy Markdown

stage-review Bot commented May 16, 2026

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 16, 2026

Greptile Summary

This PR replaces the old "detached placeholder worktree → gh pr checkout" flow with a materialize-first approach: fetch and verify the PR head against GitHub's headRefOid, create/configure the local branch, then create the worktree with a single git worktree add <path> <branch>. This eliminates the class of failures where a post-checkout hook or watcher dirties a tracked file (e.g., package-lock.json) in the placeholder worktree, causing the subsequent gh pr checkout --force to abort.

  • pr-branch-materialize.ts: New helper handles same-repo vs. cross-repo fetch, OID verification, branch creation, and tracking config; falling back from same-repo to synthetic refs/pull/N/head on fetch failure.
  • workspaces.ts: PR path updated to call materializePrBranch and then git worktree add; CLI/MCP/SDK/docs descriptions updated to remove gh pr checkout references.
  • Tests: Unit tests, real-git integration tests (including dirty-hook regression), and a full workspaces.create integration test are added.

Confidence Score: 3/5

Safe to merge for same-repo PRs; two correctness gaps in the cross-repo (synthetic-ref) path need addressing before the change is fully reliable.

The core materialize-first approach is sound and well-tested. Two issues stand out: when git worktree add fails after branch creation, the newly created local branch is silently left behind with no cleanup — the rollback only removes the worktree. Additionally, the synthetic-PR-ref path creates the local branch with the literal string FETCH_HEAD as the start-point in a separate git command from the fetch and verify steps; a concurrent fetch anywhere in the same clone could overwrite FETCH_HEAD with an unverified commit before that branch command runs. Both issues specifically affect the cross-repo / synthetic-ref code path, which is the path that was historically most problematic.

pr-branch-materialize.ts (FETCH_HEAD race in fetchSyntheticPrBranch) and workspaces.ts (missing branch cleanup in the worktree-add rollback block)

Important Files Changed

Filename Overview
packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.ts New helper that fetches, verifies, and materializes a PR branch without a checkout. FETCH_HEAD is used as the start-point for the branch-create command after a separate verification step, creating a race window where a concurrent fetch can replace FETCH_HEAD with an unverified commit.
packages/host-service/src/trpc/router/workspaces/workspaces.ts Replaces detached-worktree + gh pr checkout with materialize-first flow. Branch created by materializePrBranch is not cleaned up if the subsequent git worktree add fails, leaving an orphaned local branch in the repository.
packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.test.ts Unit tests for materializePrBranch covering same-repo, cross-repo, and OID-mismatch cases; mocks are correctly aligned with the actual git command sequence.
packages/host-service/test/integration/pr-branch-materialize.integration.test.ts Real-git integration test that proves the dirty-placeholder regression (post-checkout hook dirtying package-lock.json) no longer blocks PR workspace creation with the new flow.
packages/host-service/test/integration/workspace-create-pr.integration.test.ts End-to-end integration test for the full workspaces.create PR path; verifies gh pr checkout is never called and the correct PR head is checked out.
packages/cli/src/commands/workspaces/create/command.ts CLI flag description updated to reflect the new PR checkout mechanism; no logic changes.
packages/mcp-v2/src/tools/workspaces/create.ts MCP tool description updated to match the new PR checkout behavior; no logic changes.
packages/sdk/src/resources/workspaces.ts SDK JSDoc for WorkspaceCreateParams.pr updated; no logic changes.
plans/done/20260516-pr-worktree-checkout-flow.md Design doc explaining the old flow's failure mode, comparisons with Worktrunk/T3Code/gh CLI, and the recommended materialize-first approach with remaining follow-ups.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
packages/host-service/src/trpc/router/workspaces/workspaces.ts:639-668
**Orphaned local branch on `git worktree add` failure**

When `materializePrBranch` creates a new local branch (`createdBranch: true`) but the subsequent `git worktree add` throws, `rollbackWorktree()` is called — but `rollbackWorktree` only removes the worktree via `git worktree remove`, not the newly created branch. The plan document explicitly calls this out: "If `git worktree add` fails after a new branch was created only for this operation, delete that branch if and only if it still points at the verified PR head and is not checked out anywhere." That cleanup is absent here. Concretely, if the host filesystem is full or the branch is somehow already registered in another worktree at the time of `git worktree add`, the branch named e.g. `contributor/feature-x` will be left in the repo forever unless the user manually deletes it.

### Issue 2 of 2
packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.ts:113-138
**`FETCH_HEAD` race condition in concurrent same-repo fetches**

`FETCH_HEAD` is a single repo-level file overwritten by every `git fetch` that lacks a named destination ref. `fetchSyntheticPrBranch` fetches `refs/pull/N/head` into `FETCH_HEAD`, immediately verifies it against `headRefOid`, then returns `startPoint: "FETCH_HEAD"`. Back in `materializePrBranch`, the `git branch --no-track -- <branch> FETCH_HEAD` runs as a separate git command. If any other fetch (a second concurrent PR workspace creation, a background remote update, or a post-checkout hook) runs in the same clone between those two calls, `FETCH_HEAD` will point to a different, unverified commit, and the local branch will be created from the wrong OID — silently passing the OID guard. The fix is to fetch into a named ref (e.g., `refs/superset/pr-fetch/<number>`) instead of relying on `FETCH_HEAD`.

Reviews (1): Last reviewed commit: "fix PR worktree checkout materialization" | Re-trigger Greptile

Comment on lines 639 to 668
let attemptedWorktreeAdd = false;
try {
await git.raw(["worktree", "add", "--detach", worktreePath]);
const materialized = await materializePrBranch({
git,
branch: resolvedBranch,
remoteName: localProject.remoteName ?? "origin",
pr: prMetadata,
});
if (materialized.warning) {
console.warn(`[workspaces.create] ${materialized.warning}`);
}
attemptedWorktreeAdd = true;
await git.raw([
"worktree",
"add",
worktreePath,
resolvedBranch,
]);
} catch (err) {
if (attemptedWorktreeAdd) {
await rollbackWorktree();
}
throw new TRPCError({
code: "CONFLICT",
message:
err instanceof Error
? err.message
: "Failed to add detached worktree",
: "Failed to prepare PR worktree",
});
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Orphaned local branch on git worktree add failure

When materializePrBranch creates a new local branch (createdBranch: true) but the subsequent git worktree add throws, rollbackWorktree() is called — but rollbackWorktree only removes the worktree via git worktree remove, not the newly created branch. The plan document explicitly calls this out: "If git worktree add fails after a new branch was created only for this operation, delete that branch if and only if it still points at the verified PR head and is not checked out anywhere." That cleanup is absent here. Concretely, if the host filesystem is full or the branch is somehow already registered in another worktree at the time of git worktree add, the branch named e.g. contributor/feature-x will be left in the repo forever unless the user manually deletes it.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/host-service/src/trpc/router/workspaces/workspaces.ts
Line: 639-668

Comment:
**Orphaned local branch on `git worktree add` failure**

When `materializePrBranch` creates a new local branch (`createdBranch: true`) but the subsequent `git worktree add` throws, `rollbackWorktree()` is called — but `rollbackWorktree` only removes the worktree via `git worktree remove`, not the newly created branch. The plan document explicitly calls this out: "If `git worktree add` fails after a new branch was created only for this operation, delete that branch if and only if it still points at the verified PR head and is not checked out anywhere." That cleanup is absent here. Concretely, if the host filesystem is full or the branch is somehow already registered in another worktree at the time of `git worktree add`, the branch named e.g. `contributor/feature-x` will be left in the repo forever unless the user manually deletes it.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +113 to +138
async function fetchSyntheticPrBranch(args: {
git: GitClient;
remoteName: string;
pr: PrBranchMetadata;
warning?: string;
}): Promise<PrBranchSource> {
const syntheticRef = getSyntheticPrHeadRef(args.pr.number);
await args.git.raw([
"fetch",
"--no-tags",
"--quiet",
args.remoteName,
syntheticRef,
]);
await assertRefMatchesExpectedOid({
git: args.git,
ref: "FETCH_HEAD",
expectedHeadOid: args.pr.headRefOid,
});
return {
kind: "synthetic-pr-ref",
startPoint: "FETCH_HEAD",
mergeRef: syntheticRef,
warning: args.warning,
};
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 FETCH_HEAD race condition in concurrent same-repo fetches

FETCH_HEAD is a single repo-level file overwritten by every git fetch that lacks a named destination ref. fetchSyntheticPrBranch fetches refs/pull/N/head into FETCH_HEAD, immediately verifies it against headRefOid, then returns startPoint: "FETCH_HEAD". Back in materializePrBranch, the git branch --no-track -- <branch> FETCH_HEAD runs as a separate git command. If any other fetch (a second concurrent PR workspace creation, a background remote update, or a post-checkout hook) runs in the same clone between those two calls, FETCH_HEAD will point to a different, unverified commit, and the local branch will be created from the wrong OID — silently passing the OID guard. The fix is to fetch into a named ref (e.g., refs/superset/pr-fetch/<number>) instead of relying on FETCH_HEAD.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.ts
Line: 113-138

Comment:
**`FETCH_HEAD` race condition in concurrent same-repo fetches**

`FETCH_HEAD` is a single repo-level file overwritten by every `git fetch` that lacks a named destination ref. `fetchSyntheticPrBranch` fetches `refs/pull/N/head` into `FETCH_HEAD`, immediately verifies it against `headRefOid`, then returns `startPoint: "FETCH_HEAD"`. Back in `materializePrBranch`, the `git branch --no-track -- <branch> FETCH_HEAD` runs as a separate git command. If any other fetch (a second concurrent PR workspace creation, a background remote update, or a post-checkout hook) runs in the same clone between those two calls, `FETCH_HEAD` will point to a different, unverified commit, and the local branch will be created from the wrong OID — silently passing the OID guard. The fix is to fetch into a named ref (e.g., `refs/superset/pr-fetch/<number>`) instead of relying on `FETCH_HEAD`.

How can I resolve this? If you propose a fix, please make it concise.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.ts">

<violation number="1" location="packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.ts:134">
P1: Do not use `FETCH_HEAD` as the persisted start point for branch creation. `FETCH_HEAD` is repo-global and can be overwritten by another fetch between verification and `git branch`, which can create the PR branch at an unverified commit.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Re-trigger cubic

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.ts">

<violation number="1" location="packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.ts:258">
P2: Avoid swallowing cleanup errors with an empty catch; surface cleanup failure details so branch-materialization failures remain diagnosable.

(Based on your team's feedback about handling async rejections explicitly and avoiding empty catch blocks.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Re-trigger cubic

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.test.ts">

<violation number="1" location="packages/host-service/src/trpc/router/workspace-creation/utils/pr-branch-materialize.test.ts:211">
P2: The negative branch-creation assertion uses `fetchRef`, but branch creation now uses the verified head OID. This can let an unintended `branch --no-track` call slip through without failing the test.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic

@Kitenite Kitenite merged commit 2e414d8 into main May 17, 2026
17 checks passed
@Kitenite Kitenite deleted the fix-pr-checkout-stash branch May 17, 2026 22:32
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