Skip to content

fix(server): follow branch drift in dedicated worktrees so PRs link to their thread - #5159

Merged
t3dotgg merged 1 commit into
mainfrom
t3code/diagnose-pr-linking-failure
Aug 1, 2026
Merged

t3dotgg merged 1 commit into
mainfrom
t3code/diagnose-pr-linking-failure

fix(server): follow branch drift in dedicated worktrees so PRs link t…

2566f5c
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Effect Service Conventions succeeded Aug 1, 2026 in 1m 19s

All clear

All clear

Details

Note

Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.


🔍 Agent activity — reasoning, no tool calls

💭 I need to check the import conventions in CheckpointReactor.ts to see how Cause, Effect, and Option are being imported—whether they're coming in as namespaces from subpaths or as named imports from the main "effect" package—and verify that isTemporaryWorktreeBranch is properly imported as a named helper from the shared git utilities. The imports and helper function look good. I'm checking the error handling around line 616-624 where Effect.catchCause logs the cause using Cause.pretty() — but the conventions warn against copying raw error details into log payloads like detail, reason, or message fields, so I need to verify this isn't violating those constraints. Looking at line 540-546, the detail: error.message pattern is pre-existing code, not something I'm introducing. For the broader pattern, catchCause with interrupt re-raising is appropriate here since it's intentionally handling the entire error channel including defects, though I should check if the repo has an existing convention or helper for this catchCause + hasInterruptsOnly pattern. The repo conventions check out fine. I'm verifying that getThreadShellById and getShellSnapshot are available on ProjectionSnapshotQuery, and whether the thread.meta.update command properly supports the expectedBranch parameter—though that's more of a behavior concern than a conventions issue since I'm focused on the Effect service structure here. The Effect.catch at line 540 was modified to add .pipe(Effect.as(null)), which is allowed since it handles the entire error channel. I need to confirm that isTemporaryWorktreeBranch is exported from "@t3tools/shared/git". For the forward reference issue with followWorktreeBranchDrift being used before its declaration at line 565—since it's inside an Effect.fn that executes lazily when called, the temporal dead zone isn't actually violated here, so that's fine. I'm noticing a discrepancy between what the grep results show and what I saw in the file view — the grep at the default commit shows different code at lines 566-567 than what appeared in my earlier view, so there might be a mismatch between the revision I was looking at and the one being queried. Let me check the main branch directly to see if similar drift logic already exists there, which could mean this PR is duplicating functionality. The grep results match my expectations—the default branch has a variant that the earlier search picked up. I notice main already contains some drift-related logic around lines 566-567, which is interesting but not critical. Now I need to verify whether the thread.meta.update command accepts an expectedBranch field in the contracts, since the PR diff doesn't show any contract changes. The existing code is already in place, so this change maintains consistency. Looking at the conventions in the touched code, the imports use namespace subpath imports correctly, and there are no new errors being defined. The log payload uses Cause.pretty which aligns with the repo's patterns, though I'm considering whether this counts as arbitrary defect text in a parallel log payload—the rule about not copying arbitrary defect text applies to error attributes and sanitized error payloads, but this situation seems different. Effect.catchCause is the right choice for interrupt-aware handling, and the tests properly cover the behavior change as required. The service definition stays unchanged, and there's an existing Effect.catch at line 540 to note. In the test file, the conditional pipe with Effect.andThen and Effect.asVoid is valid—Effect.asVoid converts the result to void when used as a pipe argument, though the two branches create a union type where one returns void and the other returns the Effect's value. The schema requires JSON output, so I'll structure the response with success state and put "All clear" in the title and summary fields.


Agent Credits: 61 credits