Skip to content

Commit aa88844

Browse files
authored
Merge branch 'main' into feat/git-submodule-support
2 parents ac9b7a8 + 0de5742 commit aa88844

76 files changed

Lines changed: 4472 additions & 347 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,19 @@ body:
9696
- type: textarea
9797
id: logs
9898
attributes:
99-
label: Logs, stack traces, or screenshots
99+
label: Logs or stack traces
100100
description: Paste the most relevant output only. Redact secrets.
101101
render: shell
102102

103+
- type: upload
104+
id: attachments
105+
attributes:
106+
label: Screenshots, recordings, or supporting files
107+
description: Upload screenshots, short recordings, repro archives, or log files. Redact secrets before uploading.
108+
validations:
109+
required: false
110+
accept: ".png,.jpg,.jpeg,.gif,.webp,.svg,.mp4,.mov,.webm,.log,.txt,.json,.zip"
111+
103112
- type: textarea
104113
id: workaround
105114
attributes:

‎.github/workflows/release.yml‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,31 @@ jobs:
308308
needs: [preflight, release]
309309
runs-on: ubuntu-24.04
310310
steps:
311+
- id: app_token
312+
name: Mint release app token
313+
uses: actions/create-github-app-token@v2
314+
with:
315+
app-id: ${{ vars.RELEASE_APP_ID }}
316+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
317+
owner: ${{ github.repository_owner }}
318+
311319
- name: Checkout
312320
uses: actions/checkout@v6
313321
with:
314322
ref: main
315323
fetch-depth: 0
324+
token: ${{ steps.app_token.outputs.token }}
325+
persist-credentials: true
326+
327+
- id: app_bot
328+
name: Resolve GitHub App bot identity
329+
env:
330+
GH_TOKEN: ${{ steps.app_token.outputs.token }}
331+
APP_SLUG: ${{ steps.app_token.outputs.app-slug }}
332+
run: |
333+
user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
334+
echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
335+
echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
316336
317337
- name: Setup Bun
318338
uses: oven-sh/setup-bun@v2
@@ -349,8 +369,8 @@ jobs:
349369
exit 0
350370
fi
351371
352-
git config user.name "github-actions[bot]"
353-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
372+
git config user.name "${{ steps.app_bot.outputs.name }}"
373+
git config user.email "${{ steps.app_bot.outputs.email }}"
354374
355375
git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json bun.lock
356376
git commit -m "chore(release): prepare $RELEASE_TAG"

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ build/
1313
.logs/
1414
release/
1515
.t3
16+
.idea/
1617
apps/web/.playwright
1718
apps/web/playwright-report
1819
apps/web/src/components/__screenshots__
20+
.vitest-*

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If a tradeoff is required, choose correctness and robustness over short-term con
2121

2222
## Maintainability
2323

24-
Long term maintainability is a core priority. If you add new functionality, first check if there are shared logic that can be extracted to a separate module. Duplicate logic across mulitple files is a code smell and should be avoided. Don't be afraid to change existing code. Don't take shortcuts by just adding local logic to solve a problem.
24+
Long term maintainability is a core priority. If you add new functionality, first check if there is shared logic that can be extracted to a separate module. Duplicate logic across multiple files is a code smell and should be avoided. Don't be afraid to change existing code. Don't take shortcuts by just adding local logic to solve a problem.
2525

2626
## Package Roles
2727

‎apps/desktop/src/fixPath.ts‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎apps/desktop/src/main.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import type { ContextMenuItem } from "@t3tools/contracts";
2828
import { NetService } from "@t3tools/shared/Net";
2929
import { RotatingFileSink } from "@t3tools/shared/logging";
3030
import { showDesktopConfirmDialog } from "./confirmDialog";
31-
import { fixPath } from "./fixPath";
31+
import { syncShellEnvironment } from "./syncShellEnvironment";
3232
import { getAutoUpdateDisabledReason, shouldBroadcastDownloadProgress } from "./updateState";
3333
import {
3434
createInitialDesktopUpdateState,
@@ -44,7 +44,7 @@ import {
4444
} from "./updateMachine";
4545
import { isArm64HostRunningIntelBuild, resolveDesktopRuntimeInfo } from "./runtimeArch";
4646

47-
fixPath();
47+
syncShellEnvironment();
4848

4949
const PICK_FOLDER_CHANNEL = "desktop:pick-folder";
5050
const CONFIRM_CHANNEL = "desktop:confirm";
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { describe, expect, it, vi } from "vitest";
2+
3+
import { syncShellEnvironment } from "./syncShellEnvironment";
4+
5+
describe("syncShellEnvironment", () => {
6+
it("hydrates PATH and missing SSH_AUTH_SOCK from the login shell on macOS", () => {
7+
const env: NodeJS.ProcessEnv = {
8+
SHELL: "/bin/zsh",
9+
PATH: "/usr/bin",
10+
};
11+
const readEnvironment = vi.fn(() => ({
12+
PATH: "/opt/homebrew/bin:/usr/bin",
13+
SSH_AUTH_SOCK: "/tmp/secretive.sock",
14+
}));
15+
16+
syncShellEnvironment(env, {
17+
platform: "darwin",
18+
readEnvironment,
19+
});
20+
21+
expect(readEnvironment).toHaveBeenCalledWith("/bin/zsh", ["PATH", "SSH_AUTH_SOCK"]);
22+
expect(env.PATH).toBe("/opt/homebrew/bin:/usr/bin");
23+
expect(env.SSH_AUTH_SOCK).toBe("/tmp/secretive.sock");
24+
});
25+
26+
it("preserves an inherited SSH_AUTH_SOCK value", () => {
27+
const env: NodeJS.ProcessEnv = {
28+
SHELL: "/bin/zsh",
29+
PATH: "/usr/bin",
30+
SSH_AUTH_SOCK: "/tmp/inherited.sock",
31+
};
32+
const readEnvironment = vi.fn(() => ({
33+
PATH: "/opt/homebrew/bin:/usr/bin",
34+
SSH_AUTH_SOCK: "/tmp/login-shell.sock",
35+
}));
36+
37+
syncShellEnvironment(env, {
38+
platform: "darwin",
39+
readEnvironment,
40+
});
41+
42+
expect(env.PATH).toBe("/opt/homebrew/bin:/usr/bin");
43+
expect(env.SSH_AUTH_SOCK).toBe("/tmp/inherited.sock");
44+
});
45+
46+
it("preserves inherited values when the login shell omits them", () => {
47+
const env: NodeJS.ProcessEnv = {
48+
SHELL: "/bin/zsh",
49+
PATH: "/usr/bin",
50+
SSH_AUTH_SOCK: "/tmp/inherited.sock",
51+
};
52+
const readEnvironment = vi.fn(() => ({
53+
PATH: "/opt/homebrew/bin:/usr/bin",
54+
}));
55+
56+
syncShellEnvironment(env, {
57+
platform: "darwin",
58+
readEnvironment,
59+
});
60+
61+
expect(env.PATH).toBe("/opt/homebrew/bin:/usr/bin");
62+
expect(env.SSH_AUTH_SOCK).toBe("/tmp/inherited.sock");
63+
});
64+
65+
it("does nothing outside macOS", () => {
66+
const env: NodeJS.ProcessEnv = {
67+
SHELL: "/bin/zsh",
68+
PATH: "/usr/bin",
69+
SSH_AUTH_SOCK: "/tmp/inherited.sock",
70+
};
71+
const readEnvironment = vi.fn(() => ({
72+
PATH: "/opt/homebrew/bin:/usr/bin",
73+
SSH_AUTH_SOCK: "/tmp/secretive.sock",
74+
}));
75+
76+
syncShellEnvironment(env, {
77+
platform: "linux",
78+
readEnvironment,
79+
});
80+
81+
expect(readEnvironment).not.toHaveBeenCalled();
82+
expect(env.PATH).toBe("/usr/bin");
83+
expect(env.SSH_AUTH_SOCK).toBe("/tmp/inherited.sock");
84+
});
85+
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { readEnvironmentFromLoginShell, ShellEnvironmentReader } from "@t3tools/shared/shell";
2+
3+
export function syncShellEnvironment(
4+
env: NodeJS.ProcessEnv = process.env,
5+
options: {
6+
platform?: NodeJS.Platform;
7+
readEnvironment?: ShellEnvironmentReader;
8+
} = {},
9+
): void {
10+
if ((options.platform ?? process.platform) !== "darwin") return;
11+
12+
try {
13+
const shell = env.SHELL ?? "/bin/zsh";
14+
const shellEnvironment = (options.readEnvironment ?? readEnvironmentFromLoginShell)(shell, [
15+
"PATH",
16+
"SSH_AUTH_SOCK",
17+
]);
18+
19+
if (shellEnvironment.PATH) {
20+
env.PATH = shellEnvironment.PATH;
21+
}
22+
23+
if (!env.SSH_AUTH_SOCK && shellEnvironment.SSH_AUTH_SOCK) {
24+
env.SSH_AUTH_SOCK = shellEnvironment.SSH_AUTH_SOCK;
25+
}
26+
} catch {
27+
// Keep inherited environment if shell lookup fails.
28+
}
29+
}

‎apps/server/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444
"vitest": "catalog:"
4545
},
4646
"engines": {
47-
"node": "^22.13 || ^23.4 || >=24.10"
47+
"node": "^22.16 || ^23.11 || >=24.10"
4848
}
4949
}

‎apps/server/src/git/Layers/CodexTextGeneration.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { randomUUID } from "node:crypto";
33
import { Effect, FileSystem, Layer, Option, Path, Schema, Stream } from "effect";
44
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
55

6+
import { DEFAULT_GIT_TEXT_GENERATION_MODEL } from "@t3tools/contracts";
67
import { sanitizeBranchFragment, sanitizeFeatureBranchName } from "@t3tools/shared/git";
78

89
import { resolveAttachmentPath } from "../../attachmentStore.ts";
@@ -17,7 +18,6 @@ import {
1718
TextGeneration,
1819
} from "../Services/TextGeneration.ts";
1920

20-
const CODEX_MODEL = "gpt-5.3-codex";
2121
const CODEX_REASONING_EFFORT = "low";
2222
const CODEX_TIMEOUT_MS = 180_000;
2323

@@ -187,13 +187,15 @@ const makeCodexTextGeneration = Effect.gen(function* () {
187187
outputSchemaJson,
188188
imagePaths = [],
189189
cleanupPaths = [],
190+
model,
190191
}: {
191192
operation: "generateCommitMessage" | "generatePrContent" | "generateBranchName";
192193
cwd: string;
193194
prompt: string;
194195
outputSchemaJson: S;
195196
imagePaths?: ReadonlyArray<string>;
196197
cleanupPaths?: ReadonlyArray<string>;
198+
model?: string;
197199
}): Effect.Effect<S["Type"], TextGenerationError, S["DecodingServices"]> =>
198200
Effect.gen(function* () {
199201
const schemaPath = yield* writeTempFile(
@@ -212,7 +214,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {
212214
"-s",
213215
"read-only",
214216
"--model",
215-
CODEX_MODEL,
217+
model ?? DEFAULT_GIT_TEXT_GENERATION_MODEL,
216218
"--config",
217219
`model_reasoning_effort="${CODEX_REASONING_EFFORT}"`,
218220
"--output-schema",
@@ -353,6 +355,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {
353355
cwd: input.cwd,
354356
prompt,
355357
outputSchemaJson,
358+
...(input.model ? { model: input.model } : {}),
356359
}).pipe(
357360
Effect.map(
358361
(generated) =>
@@ -398,6 +401,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {
398401
title: Schema.String,
399402
body: Schema.String,
400403
}),
404+
...(input.model ? { model: input.model } : {}),
401405
}).pipe(
402406
Effect.map(
403407
(generated) =>
@@ -449,6 +453,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {
449453
branch: Schema.String,
450454
}),
451455
imagePaths,
456+
...(input.model ? { model: input.model } : {}),
452457
});
453458

454459
return {

0 commit comments

Comments
 (0)