Skip to content

fix(server): merged PRs update and auto-settle threads again - #13476

Merged
juliusmarminge merged 1 commit into
pingdotgg:t3code/codex-turn-mappingfrom
Bil0000:fix/v2-pr-sync-repository-identity
Sep 24, 2026
Merged

juliusmarminge merged 1 commit into
pingdotgg:t3code/codex-turn-mappingfrom
Bil0000:fix/v2-pr-sync-repository-identity

Conversation

@Bil0000

@Bil0000 Bil0000 commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Problem

On the new orchestrator, a thread's linked PR can stay "open" in the sidebar after it is merged or closed. Because of this, auto-settle never settles the thread.

The branch reads project shells through ProjectEnrichmentService.getAvailable. That call only checks a cache: on a miss, it returns repositoryIdentity: null and fills the cache in the background. The cache keeps a result for 1 minute, and PullRequestSyncReactor also runs every minute. So the sweep often reads a project with no identity. Then PullRequestService.requireProject finds no supported host and fails with PullRequestUnavailableError: Change requests cannot be browsed for this project's host yet. The link snapshot stays open, and resolveAutoSettlementAt does not settle a thread while any of its links is open.

On a live install, the traces show 143 failed and 11 successful canonicalRef calls across 3 log files. The "pull request sync skipped" warning does not log the cause, so the failure was hard to see. main does not have this bug, because its project shell reads resolve the identity with RepositoryIdentityResolver and wait for the answer.

Fix

In PullRequestService.listWorkspaceProjects, if a project shell has no cached identity, resolve it with RepositoryIdentityResolver before routing. A shell that already has an identity costs nothing extra. For a missing one, the resolver's own cache (1 minute) is used, so this is the same lookup that main does on every read. Only the PR service changes. The sidebar and other callers that read enrichment still get the non-blocking cached path.

Verification

  • New test: a project shell with repositoryIdentity: null still routes a summary read. It fails before the fix with the error above, and passes after it.
  • vp test run src/pullRequest/ src/git/ src/orchestration/PullRequestSyncReactor* src/orchestration-v2/RunFinalizationService.test.ts: 28 files, 967 tests pass.
  • tsc --noEmit for apps/server, plus vp lint and vp fmt --check on the touched files: clean.

Risk

A PR read for a project that is not a git repository now runs one resolver lookup. This lookup is cached. For a path with no git root, the root is not cached and git runs again on the next read, the same as main.

Made by Claude Opus 5.5 in Claude Code.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 24, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at cdbe11f

Macroscope's review found this PR approvable — This is a focused server bug fix that restores repository identity resolution for existing pull-request operations, with bounded concurrency and regression coverage. It introduces no schema, deployment, security, billing, authentication, default, or static-analysis changes.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge merged commit 52c336a into pingdotgg:t3code/codex-turn-mapping Sep 24, 2026
24 checks passed
juliusmarminge pushed a commit that referenced this pull request Sep 24, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge pushed a commit that referenced this pull request Sep 24, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge pushed a commit that referenced this pull request Sep 25, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants