Skip to content

Commit c53f5e3

Browse files
committed
Fix CodeRabbit review issues from PR #6
- Add response.ok check in fetchLatestRelease to handle API errors - Move isUnknownPendingApprovalRequestError check before failure append - Remove unused Array import from ProviderHealth.ts - Default hasOriginRemote to true while loading in GitActionsControl
1 parent f61eb05 commit c53f5e3

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

apps/marketing/src/lib/releases.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ export async function fetchLatestRelease(): Promise<Release> {
2020
const cached = sessionStorage.getItem(CACHE_KEY);
2121
if (cached) return JSON.parse(cached);
2222

23-
const data = await fetch(API_URL).then((r) => r.json());
23+
const response = await fetch(API_URL);
24+
if (!response.ok) {
25+
throw new Error(`Failed to fetch latest release (${response.status})`);
26+
}
27+
const data = (await response.json()) as Release;
2428

2529
if (data?.assets) {
2630
sessionStorage.setItem(CACHE_KEY, JSON.stringify(data));

apps/server/src/orchestration/Layers/ProviderCommandReactor.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ const make = Effect.gen(function* () {
561561
if (Cause.hasInterruptsOnly(cause)) {
562562
return yield* Effect.failCause(cause);
563563
}
564+
if (isUnknownPendingApprovalRequestError(cause)) return;
564565
yield* appendProviderFailureActivity({
565566
threadId: event.payload.threadId,
566567
kind: "provider.approval.respond.failed",
@@ -570,8 +571,6 @@ const make = Effect.gen(function* () {
570571
createdAt: event.payload.createdAt,
571572
requestId: event.payload.requestId,
572573
});
573-
574-
if (!isUnknownPendingApprovalRequestError(cause)) return;
575574
}),
576575
),
577576
);

apps/server/src/provider/Layers/ProviderHealth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
ServerProviderStatusState,
1818
} from "@t3tools/contracts";
1919
import { CopilotClient, type ModelInfo } from "@github/copilot-sdk";
20-
import { Array, Effect, Fiber, FileSystem, Layer, Option, Path, Result, Stream } from "effect";
20+
import { Effect, Fiber, FileSystem, Layer, Option, Path, Result, Stream } from "effect";
2121
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
2222

2323
import { resolveBundledCopilotCliPath, withSanitizedCopilotDesktopEnv } from "./copilotCliPath.ts";

apps/web/src/components/GitActionsControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions
173173
const { data: branchList = null } = useQuery(gitBranchesQueryOptions(gitCwd));
174174
// Default to true while loading so we don't flash init controls.
175175
const isRepo = branchList?.isRepo ?? true;
176-
const hasOriginRemote = branchList?.hasOriginRemote ?? false;
176+
const hasOriginRemote = branchList?.hasOriginRemote ?? true;
177177
const currentBranch = branchList?.branches.find((branch) => branch.current)?.name ?? null;
178178
const isGitStatusOutOfSync =
179179
!!gitStatus?.branch && !!currentBranch && gitStatus.branch !== currentBranch;

0 commit comments

Comments
 (0)