Skip to content

Commit bc0d4c3

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-27412
2 parents aa315fd + 476590d commit bc0d4c3

69 files changed

Lines changed: 2401 additions & 186 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.

‎apps/desktop/src/ipc/channels.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const SNAP_SHOT_EVENT_CHANNEL = "desktop:snap-shot-event";
1414
export const WEB_LINK_OPEN_CHANNEL = "desktop:web-link-open";
1515
export const WEB_LINK_READY_CHANNEL = "desktop:web-link-ready";
1616
export const QUIT_SHORTCUT_CHANNEL = "desktop:quit-shortcut";
17+
export const TRACKPAD_SCROLL_BEGIN_CHANNEL = "desktop:trackpad-scroll-begin";
1718
export const TRACKPAD_SCROLL_END_CHANNEL = "desktop:trackpad-scroll-end";
1819
export const GET_WINDOW_FULLSCREEN_STATE_CHANNEL = "desktop:get-window-fullscreen-state";
1920
export const WINDOW_FULLSCREEN_STATE_CHANNEL = "desktop:window-fullscreen-state";

‎apps/desktop/src/preload.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ contextBridge.exposeInMainWorld("desktopBridge", {
9191
ipcRenderer.on(IpcChannels.SET_NOTIFICATION_BADGE_CHANNEL, handler);
9292
return () => ipcRenderer.removeListener(IpcChannels.SET_NOTIFICATION_BADGE_CHANNEL, handler);
9393
},
94+
onTrackpadScrollBegin: (listener) => {
95+
const handler = () => listener();
96+
ipcRenderer.on(IpcChannels.TRACKPAD_SCROLL_BEGIN_CHANNEL, handler);
97+
return () => ipcRenderer.removeListener(IpcChannels.TRACKPAD_SCROLL_BEGIN_CHANNEL, handler);
98+
},
9499
onTrackpadScrollEnd: (listener) => {
95100
const handler = () => listener();
96101
ipcRenderer.on(IpcChannels.TRACKPAD_SCROLL_END_CHANNEL, handler);

‎apps/desktop/src/window/DesktopWindow.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
MENU_ACTION_CHANNEL,
2424
QUIT_SHORTCUT_CHANNEL,
2525
SNAP_SHOT_EVENT_CHANNEL,
26+
TRACKPAD_SCROLL_BEGIN_CHANNEL,
2627
TRACKPAD_SCROLL_END_CHANNEL,
2728
WINDOW_FULLSCREEN_STATE_CHANNEL,
2829
} from "../ipc/channels.ts";
@@ -652,7 +653,11 @@ export const make = Effect.gen(function* () {
652653
}
653654
});
654655
window.webContents.on("input-event", (_event, input) => {
655-
if (input.type === "gestureScrollEnd") window.webContents.send(TRACKPAD_SCROLL_END_CHANNEL);
656+
if (input.type === "gestureScrollBegin") {
657+
window.webContents.send(TRACKPAD_SCROLL_BEGIN_CHANNEL);
658+
} else if (input.type === "gestureScrollEnd") {
659+
window.webContents.send(TRACKPAD_SCROLL_END_CHANNEL);
660+
}
656661
});
657662
// Ctrl+wheel bypasses menus; guest contents emit their own zoom-changed event.
658663
window.webContents.on("zoom-changed", (_event, direction) => {

‎apps/mobile/src/features/settings/SettingsEnvironmentDetailRouteScreen.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ function EnvironmentDetail({ environmentId }: { readonly environmentId: Environm
294294
void run("refresh", async () => {
295295
if (!readEnvironmentScope(environmentId, AuthOrchestrationReadScope))
296296
return;
297-
const result = await refreshProviders({ environmentId, input: {} });
297+
const result = await refreshProviders({
298+
environmentId,
299+
input: { reloadSecrets: true },
300+
});
298301
if (AsyncResult.isFailure(result)) throw squashAtomCommandFailure(result);
299302
setNotice("Provider status refreshed.");
300303
});

‎apps/server/package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
"@opencode-ai/sdk": "^1.3.15",
7979
"@t3tools/contracts": "workspace:*",
8080
"@t3tools/provider-testing": "workspace:*",
81+
"@t3tools/secret-provider-core": "workspace:*",
82+
"@t3tools/secret-provider-definitions": "workspace:*",
83+
"@t3tools/secret-provider-onepassword": "workspace:*",
8184
"@t3tools/shared": "workspace:*",
8285
"@t3tools/source-control-testing": "workspace:*",
8386
"@t3tools/ssh": "workspace:*",

‎apps/server/src/auth/RpcAuthorization.test.ts‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
AuthProvidersManageScope,
66
AuthSettingsWriteScope,
77
DEFAULT_SERVER_SETTINGS,
8+
ProviderDriverKind,
89
ProviderInstanceId,
910
SecretProviderId,
1011
ThreadId,
@@ -164,13 +165,34 @@ describe("settings mutation authorization", () => {
164165
);
165166
yield* client[WS_METHODS.serverUpdateSettings]({ patch: {}, providerInstanceMutation });
166167
expect(handled).toBe(1);
168+
yield* client[WS_METHODS.serverUpdateSettings]({
169+
patch: {},
170+
providerInstanceMutation: {
171+
operation: "upsert",
172+
instanceId: ProviderInstanceId.make("codex_work"),
173+
instance: {
174+
driver: ProviderDriverKind.make("codex"),
175+
environment: [
176+
{
177+
name: "OPENAI_API_KEY",
178+
sensitive: true,
179+
value: {
180+
provider: SecretProviderId.make("personal"),
181+
reference: "op://Private/OpenAI/credential",
182+
},
183+
},
184+
],
185+
},
186+
},
187+
});
188+
expect(handled).toBe(2);
167189
expect(
168190
yield* client[WS_METHODS.serverUpdateSettings]({
169191
patch: { defaultRuntimeMode: "full-access" },
170192
providerInstanceMutation,
171193
}).pipe(Effect.flip),
172194
).toMatchObject({ requiredPermission: AuthSettingsWriteScope });
173-
expect(handled).toBe(1);
195+
expect(handled).toBe(2);
174196
}).pipe(Effect.scoped),
175197
);
176198

‎apps/server/src/auth/RpcAuthorization.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ const SettingsUpdate = Schema.Struct({
228228
patch: ServerSettingsPatch,
229229
providerInstanceMutation: Schema.optionalKey(ProviderInstanceMutation),
230230
});
231-
const decodeSettingsUpdate = Schema.decodeUnknownSync(SettingsUpdate);
231+
// Middleware receives the payload already decoded, so it is checked against the decoded shape.
232+
const decodeSettingsUpdate = Schema.decodeUnknownSync(Schema.toType(SettingsUpdate));
232233

233234
const requiredScopesForSettingsUpdate = (payload: unknown) => {
234235
const input = decodeSettingsUpdate(payload);

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
OrchestrationV2ProviderThread,
4141
ProjectId,
4242
ProviderInstanceId,
43-
type ProviderInstanceEnvironment,
43+
type ResolvedProviderInstanceEnvironment,
4444
ProviderDriverKind,
4545
type ProviderReplayTranscript,
4646
type ProviderApprovalDecision,
@@ -1189,7 +1189,7 @@ describe("ClaudeAdapterV2 approval cancellation", () => {
11891189

11901190
const captureSdkExecutablePaths = Effect.fn("captureSdkExecutablePaths")(function* (
11911191
binaryPath: string,
1192-
environment: ProviderInstanceEnvironment = [],
1192+
environment: ResolvedProviderInstanceEnvironment = [],
11931193
) {
11941194
const executablePaths: Array<string | undefined> = [];
11951195
const taskToolEnvironment: Array<string | undefined> = [];

‎apps/server/src/orchestration-v2/Adapters/PiAdapterV2.testkit.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as NodeServices from "@effect/platform-node/NodeServices";
22
import {
33
ProviderReplayEntry,
44
ProviderInstanceId,
5-
type ProviderInstanceEnvironment,
5+
type ResolvedProviderInstanceEnvironment,
66
type ProviderReplayTranscript,
77
type ProviderReplayEntry as ProviderReplayEntryType,
88
} from "@t3tools/contracts";
@@ -363,7 +363,7 @@ export function layer<E, R>(input: {
363363
readonly spawner: Layer.Layer<ChildProcessSpawner.ChildProcessSpawner, E, R>;
364364
readonly binaryPath: string;
365365
readonly launchArgs: string;
366-
readonly environment?: ProviderInstanceEnvironment;
366+
readonly environment?: ResolvedProviderInstanceEnvironment;
367367
}) {
368368
return ProviderAdapterRegistry.layerFromAdaptersEffect(
369369
PiAdapterV2Driver.create({

‎apps/server/src/project/AgentSessionScanner.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,9 +1112,11 @@ export const make = Effect.gen(function* () {
11121112
const seenHomes = new Set<string>();
11131113
for (const { instanceId, config: instance } of instances) {
11141114
const homeVariable = source === "claudeAgent" ? "CLAUDE_CONFIG_DIR" : "CODEX_HOME";
1115+
const configuredHome = instance.environment?.findLast(
1116+
(variable) => variable.name === homeVariable,
1117+
)?.value;
11151118
const environmentHome =
1116-
instance.environment?.findLast((variable) => variable.name === homeVariable)?.value ??
1117-
hostEnvironment[homeVariable];
1119+
typeof configuredHome === "string" ? configuredHome : hostEnvironment[homeVariable];
11181120

11191121
let homePath: string;
11201122
if (source === "claudeAgent") {

0 commit comments

Comments
 (0)