@devries-cameron20 / t3code-1 / commits / 350d76ee14
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

[codex] Align GitHub source control adapter errors (#2476)

Co-authored-by: Julius Marminge <julius@macmini.local>

Julius Marminge committed May 2, 2026 at 16:59 UTC 350d76ee141004e202d6c365d29ffdb29bde66c6
5 files changed +16 -17
apps/server/src/git/GitManager.test.ts
+2 -1
@@ -14,9 +14,10 @@ import type {
14 ThreadId,
15 } from "@t3tools/contracts";
16
17 -import { GitCommandError, GitHubCliError, TextGenerationError } from "@t3tools/contracts";
17 +import { GitCommandError, TextGenerationError } from "@t3tools/contracts";
18 import { type GitManagerShape } from "./GitManager.ts";
19 import {
20 + GitHubCliError,
21 type GitHubCliShape,
22 type GitHubPullRequestSummary,
23 GitHubCli,
apps/server/src/sourceControl/GitHubCli.ts
+12 -2
@@ -1,16 +1,26 @@
1 import { Context, Effect, Layer, Result, Schema, SchemaIssue } from "effect";
2
3 -import { GitHubCliError, TrimmedNonEmptyString, type VcsError } from "@t3tools/contracts";
3 +import { TrimmedNonEmptyString, type VcsError } from "@t3tools/contracts";
4
5 import { VcsProcess, type VcsProcessOutput } from "../vcs/VcsProcess.ts";
6 import {
7 decodeGitHubPullRequestJson,
8 decodeGitHubPullRequestListJson,
9 formatGitHubJsonDecodeError,
10 -} from "../git/githubPullRequests.ts";
10 +} from "./gitHubPullRequests.ts";
11
12 const DEFAULT_TIMEOUT_MS = 30_000;
13
14 +export class GitHubCliError extends Schema.TaggedErrorClass<GitHubCliError>()("GitHubCliError", {
15 + operation: Schema.String,
16 + detail: Schema.String,
17 + cause: Schema.optional(Schema.Defect),
18 +}) {
19 + override get message(): string {
20 + return `GitHub CLI failed in ${this.operation}: ${this.detail}`;
21 + }
22 +}
23 +
24 export interface GitHubPullRequestSummary {
25 readonly number: number;
26 readonly title: string;
apps/server/src/sourceControl/GitHubSourceControlProvider.ts
+2 -3
@@ -3,11 +3,10 @@ import {
3 SourceControlProviderError,
4 type ChangeRequest,
5 type ChangeRequestState,
6 - type GitHubCliError,
6 } from "@t3tools/contracts";
7
9 -import { GitHubCli, type GitHubPullRequestSummary } from "./GitHubCli.ts";
10 -import { decodeGitHubPullRequestListJson } from "../git/githubPullRequests.ts";
8 +import { GitHubCli, type GitHubCliError, type GitHubPullRequestSummary } from "./GitHubCli.ts";
9 +import { decodeGitHubPullRequestListJson } from "./gitHubPullRequests.ts";
10 import { SourceControlProvider, type SourceControlProviderShape } from "./SourceControlProvider.ts";
11
12 function providerError(operation: string, cause: GitHubCliError): SourceControlProviderError {
apps/server/src/sourceControl/gitHubPullRequests.ts renamed
packages/contracts/src/git.ts
-11
@@ -328,16 +328,6 @@ export class GitCommandError extends Schema.TaggedErrorClass<GitCommandError>()(
328 }
329 }
330
331 -export class GitHubCliError extends Schema.TaggedErrorClass<GitHubCliError>()("GitHubCliError", {
332 - operation: Schema.String,
333 - detail: Schema.String,
334 - cause: Schema.optional(Schema.Defect),
335 -}) {
336 - override get message(): string {
337 - return `GitHub CLI failed in ${this.operation}: ${this.detail}`;
338 - }
339 -}
340 -
331 export class TextGenerationError extends Schema.TaggedErrorClass<TextGenerationError>()(
332 "TextGenerationError",
333 {
@@ -364,7 +354,6 @@ export class GitManagerError extends Schema.TaggedErrorClass<GitManagerError>()(
354 export const GitManagerServiceError = Schema.Union([
355 GitManagerError,
356 GitCommandError,
367 - GitHubCliError,
357 SourceControlProviderError,
358 TextGenerationError,
359 ]);