Skip to content

Commit 17532ea

Browse files
committed
feat(providers): add Oh My Pi support
1 parent 8f7da3b commit 17532ea

45 files changed

Lines changed: 4169 additions & 59 deletions

Some content is hidden

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

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
T3 Code is an "agent harness control surface". It enables control of the agents on your machine with a best-in-class mobile app ([iOS](https://apps.apple.com/us/app/t3-code-remote-claude-more/id6787819824), [Android](https://play.google.com/store/apps/details?id=com.t3tools.t3code)), [web app](https://app.t3.codes) and [Electron-based desktop app](https://t3.codes).
44

5-
Works with your subscriptions on Claude Code, Codex, Cursor, Grok Build, and OpenCode. If they're set up on your computer, T3 Code can control them.
5+
Works with your subscriptions on Claude Code, Codex, Cursor, Grok Build, OpenCode, and Oh My Pi. If they're set up on your computer, T3 Code can control them.
66

77
## "Wait, what are you selling me?"
88

@@ -13,13 +13,14 @@ We wanted something performant, remote-ready, and truly open. If we ever go the
1313
## Installation
1414

1515
> [!WARNING]
16-
> T3 Code currently supports Codex, Claude, Cursor, Grok Build and OpenCode. Install and authenticate at least one provider before use:
16+
> T3 Code currently supports Codex, Claude, Cursor, Grok Build, OpenCode, and Oh My Pi. Install and authenticate at least one provider before use:
1717
>
1818
> - Codex: install [Codex CLI](https://developers.openai.com/codex/cli) and run `codex login`
1919
> - Claude: install [Claude Code](https://claude.com/product/claude-code) and run `claude auth login`
2020
> - Cursor: install [Cursor CLI](https://cursor.com/cli) and run `agent login`
2121
> - Grok Build: install [Grok Build CLI](https://x.ai/cli) and run `grok login`
2222
> - OpenCode: install [OpenCode](https://opencode.ai) and run `opencode auth login`
23+
> - Oh My Pi: install [Oh My Pi](https://omp.sh) and run `omp setup`
2324
2425
### Try it out (install-free)
2526

‎apps/mobile/THIRD_PARTY_NOTICES.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Third-Party Notices
2+
3+
## Oh My Pi
4+
5+
The Oh My Pi provider icon in `src/components/ProviderIcon.tsx` is adapted
6+
from the [`oh-my-pi`](https://github.com/can1357/oh-my-pi) project.
7+
8+
Copyright (c) 2025 Mario Zechner
9+
10+
Copyright (c) 2025-2026 Can Bölük
11+
12+
Copyright (c) 2026 Stencil Labs, Inc.
13+
14+
Licensed under the MIT License. The full license text is available in the
15+
upstream repository: <https://github.com/can1357/oh-my-pi/blob/main/LICENSE>.

‎apps/mobile/src/components/ProviderIcon.tsx‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Path, Svg } from "react-native-svg";
1+
import { Circle, Path, Rect, Svg } from "react-native-svg";
22
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
33

44
type ProviderIconProps = {
@@ -59,6 +59,22 @@ export function ProviderIcon(props: ProviderIconProps) {
5959
);
6060
}
6161

62+
if (props.provider === "omp") {
63+
const fill = isDarkMode ? "#FAFAFA" : "#211E1E";
64+
return (
65+
<Svg width={size} height={size} viewBox="0 0 120 90" fill="none">
66+
<Rect x="10" y="8" width="100" height="12" rx="2" fill={fill} />
67+
<Rect x="25" y="20" width="12" height="62" rx="2" fill={fill} />
68+
<Rect x="75" y="20" width="12" height="45" rx="2" fill={fill} />
69+
<Rect x="71" y="55" width="20" height="16" rx="3" fill="#F97316" />
70+
<Rect x="75" y="59" width="4" height="8" rx="1" fill="#211E1E" />
71+
<Rect x="83" y="59" width="4" height="8" rx="1" fill="#211E1E" />
72+
<Circle cx="18" cy="14" r="2" fill="#F97316" opacity={0.8} />
73+
<Circle cx="102" cy="14" r="2" fill="#F97316" opacity={0.8} />
74+
</Svg>
75+
);
76+
}
77+
6278
// codex (and unknown drivers)
6379
return (
6480
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">

‎apps/mobile/src/features/threads/ThreadSettingsSheet.tsx‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ function ModelRow(props: {
9494
const checkmarkColor = useThemeColor("--color-icon");
9595
return (
9696
<Pressable
97-
accessibilityLabel={props.option.label}
97+
accessibilityLabel={
98+
props.option.subProvider
99+
? `${props.option.label}. ${props.option.subProvider}`
100+
: props.option.label
101+
}
98102
accessibilityRole="radio"
99103
accessibilityState={{ checked: props.selected }}
100104
onPress={props.onPress}
@@ -104,9 +108,16 @@ function ModelRow(props: {
104108
props.isLast ? "rounded-b-2xl" : "border-b border-border-subtle",
105109
)}
106110
>
107-
<Text className="min-w-0 shrink text-base font-t3-medium text-foreground" numberOfLines={1}>
108-
{props.option.label}
109-
</Text>
111+
<View className="min-w-0 shrink gap-0.5">
112+
<Text className="text-base font-t3-medium text-foreground" numberOfLines={1}>
113+
{props.option.label}
114+
</Text>
115+
{props.option.subProvider ? (
116+
<Text className="text-xs text-foreground-muted" numberOfLines={1}>
117+
{props.option.subProvider}
118+
</Text>
119+
) : null}
120+
</View>
110121
{props.option.isDefault ? (
111122
<View className="rounded-md bg-subtle-strong px-1.5 py-0.5">
112123
<Text className="text-3xs font-t3-bold text-foreground-muted">Default</Text>

‎apps/mobile/src/features/threads/new-task-flow-provider.tsx‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
groupByProvider,
3535
resolveDefaultableModelSelection,
3636
resolveSelectableModelSelection,
37+
selectedProviderShowsInteractionModeToggle,
3738
} from "../../lib/modelOptions";
3839
import { scopedProjectKey } from "../../lib/scopedEntities";
3940
import { appAtomRegistry } from "../../state/atom-registry";
@@ -194,7 +195,8 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
194195
const threads = useThreadShells();
195196
const { savedConnectionsById } = useSavedRemoteConnections();
196197
const groupingSettings = useMobileProjectGroupingSettings();
197-
const { enabled: planModeEnabled, loaded: planModePreferenceLoaded } = useLegacyPlanModeState();
198+
const { enabled: planModePreferenceEnabled, loaded: planModePreferenceLoaded } =
199+
useLegacyPlanModeState();
198200
const projectScopes = useMemo(
199201
() =>
200202
sortHomeProjectScopes({
@@ -401,9 +403,6 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
401403
selectedEnvironmentServerConfig?.settings.newWorktreesStartFromOrigin ??
402404
true;
403405
const runtimeMode = selectedProjectDraft.runtimeMode ?? DEFAULT_RUNTIME_MODE;
404-
const interactionMode = planModeEnabled
405-
? (selectedProjectDraft.interactionMode ?? DEFAULT_PROVIDER_INTERACTION_MODE)
406-
: DEFAULT_PROVIDER_INTERACTION_MODE;
407406

408407
// Stored selections only count while their provider is usable on the
409408
// server; otherwise the server's default model wins instead of silently
@@ -433,6 +432,12 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
433432
modelOptions.find((option) => option.isDefault)?.selection ??
434433
modelOptions[0]?.selection ??
435434
null;
435+
const planModeEnabled =
436+
planModePreferenceEnabled &&
437+
selectedProviderShowsInteractionModeToggle(selectedEnvironmentServerConfig, selectedModel);
438+
const interactionMode = planModeEnabled
439+
? (selectedProjectDraft.interactionMode ?? DEFAULT_PROVIDER_INTERACTION_MODE)
440+
: DEFAULT_PROVIDER_INTERACTION_MODE;
436441
const selectedModelKey = selectedModel
437442
? `${selectedModel.instanceId}:${selectedModel.model}`
438443
: null;

‎apps/mobile/src/lib/modelOptions.test.ts‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,43 @@ import {
77
groupByProvider,
88
resolveDefaultableModelSelection,
99
resolveSelectableModelSelection,
10+
selectedProviderShowsInteractionModeToggle,
1011
} from "./modelOptions";
1112

1213
describe("mobile model options", () => {
14+
it("preserves the upstream provider for OMP model rows", () => {
15+
const config = {
16+
providers: [
17+
{
18+
instanceId: "omp",
19+
driver: "omp",
20+
displayName: "Oh My Pi",
21+
enabled: true,
22+
installed: true,
23+
auth: { status: "authenticated" },
24+
models: [
25+
{
26+
slug: "moonshot/kimi-k2.6",
27+
name: "Kimi K2.6",
28+
subProvider: "Moonshot",
29+
isCustom: false,
30+
capabilities: null,
31+
},
32+
],
33+
},
34+
],
35+
} as unknown as ServerConfig;
36+
37+
expect(buildModelOptions(config, null)).toMatchObject([
38+
{
39+
label: "Kimi K2.6",
40+
providerLabel: "Oh My Pi",
41+
subProvider: "Moonshot",
42+
subtitle: "Oh My Pi · Moonshot",
43+
},
44+
]);
45+
});
46+
1347
it("groups models by provider and flags legacy entries", () => {
1448
const config = {
1549
providers: [
@@ -171,4 +205,32 @@ describe("mobile model options", () => {
171205
// Offline: nothing to validate against, selection passes through.
172206
expect(resolveDefaultableModelSelection(null, legacy)).toBe(legacy);
173207
});
208+
209+
it("uses the selected provider interaction-mode capability", () => {
210+
const config = {
211+
providers: [
212+
{
213+
instanceId: "omp",
214+
driver: "omp",
215+
enabled: true,
216+
installed: true,
217+
auth: { status: "authenticated" },
218+
showInteractionModeToggle: false,
219+
models: [],
220+
},
221+
],
222+
} as unknown as ServerConfig;
223+
const ompSelection = {
224+
instanceId: ProviderInstanceId.make("omp"),
225+
model: "moonshot/kimi-k2.6",
226+
};
227+
const missingSelection = {
228+
instanceId: ProviderInstanceId.make("codex"),
229+
model: "gpt-5.6-sol",
230+
};
231+
232+
expect(selectedProviderShowsInteractionModeToggle(config, ompSelection)).toBe(false);
233+
expect(selectedProviderShowsInteractionModeToggle(config, missingSelection)).toBe(true);
234+
expect(selectedProviderShowsInteractionModeToggle(null, ompSelection)).toBe(true);
235+
});
174236
});

‎apps/mobile/src/lib/modelOptions.ts‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type ModelOption = {
1414
readonly subtitle: string;
1515
readonly providerKey: string;
1616
readonly providerLabel: string;
17+
readonly subProvider?: string;
1718
readonly providerDriver: string;
1819
readonly isDefault: boolean;
1920
readonly isLegacy: boolean;
@@ -35,6 +36,7 @@ function providerDisplayLabel(provider: {
3536
if (provider.displayName) return provider.displayName;
3637
if (provider.driver === "codex") return "Codex";
3738
if (provider.driver === "claudeAgent") return "Claude";
39+
if (provider.driver === "omp") return "Oh My Pi";
3840
return provider.instanceId;
3941
}
4042

@@ -104,6 +106,24 @@ export function resolveDefaultableModelSelection(
104106
return model?.isLegacy === true ? null : usable;
105107
}
106108

109+
/**
110+
* The server owns whether a provider supports interaction-mode selection. If
111+
* the environment is offline or the selected provider is not in its latest
112+
* snapshot, preserve the existing control until the server can describe it.
113+
*/
114+
export function selectedProviderShowsInteractionModeToggle(
115+
config: T3ServerConfig | null | undefined,
116+
selection: ModelSelection | null,
117+
): boolean {
118+
if (!config || !selection) {
119+
return true;
120+
}
121+
return (
122+
config.providers.find((provider) => provider.instanceId === selection.instanceId)
123+
?.showInteractionModeToggle ?? true
124+
);
125+
}
126+
107127
export function buildModelOptions(
108128
config: T3ServerConfig | null | undefined,
109129
fallbackModelSelection: ModelSelection | null,
@@ -118,12 +138,14 @@ export function buildModelOptions(
118138
const providerLabel = providerDisplayLabel(provider);
119139
for (const model of provider.models) {
120140
const key = `${provider.instanceId}:${model.slug}`;
141+
const subProvider = model.subProvider?.trim();
121142
options.set(key, {
122143
key,
123144
label: model.name,
124-
subtitle: providerLabel,
145+
subtitle: subProvider ? `${providerLabel} · ${subProvider}` : providerLabel,
125146
providerKey: provider.instanceId,
126147
providerLabel,
148+
...(subProvider ? { subProvider } : {}),
127149
providerDriver: provider.driver,
128150
isDefault: model.isDefault === true,
129151
isLegacy: model.isLegacy === true,

‎apps/server/scripts/acp-mock-agent.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type * as AcpSchema from "effect-acp/schema";
1414
const requestLogPath = process.env.T3_ACP_REQUEST_LOG_PATH;
1515
const exitLogPath = process.env.T3_ACP_EXIT_LOG_PATH;
1616
const emitToolCalls = process.env.T3_ACP_EMIT_TOOL_CALLS === "1";
17+
const emitEditPermission = process.env.T3_ACP_EMIT_EDIT_PERMISSION === "1";
1718
const emitInterleavedAssistantToolCalls =
1819
process.env.T3_ACP_EMIT_INTERLEAVED_ASSISTANT_TOOL_CALLS === "1";
1920
const emitGenericToolPlaceholders = process.env.T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS === "1";
@@ -660,15 +661,18 @@ const program = Effect.gen(function* () {
660661
sessionId: requestedSessionId,
661662
toolCall: {
662663
toolCallId,
663-
title: "`cat server/package.json`",
664-
kind: "execute",
664+
title: emitEditPermission ? "Delete obsolete file" : "`cat server/package.json`",
665+
...(emitEditPermission ? {} : { kind: "execute" as const }),
665666
status: "pending",
667+
...(emitEditPermission ? { locations: [{ path: "/tmp/obsolete.ts" }] } : {}),
666668
content: [
667669
{
668670
type: "content",
669671
content: {
670672
type: "text",
671-
text: "Not in allowlist: cat server/package.json",
673+
text: emitEditPermission
674+
? "Delete obsolete file"
675+
: "Not in allowlist: cat server/package.json",
672676
},
673677
},
674678
],
@@ -693,8 +697,8 @@ const program = Effect.gen(function* () {
693697
update: {
694698
sessionUpdate: "tool_call_update",
695699
toolCallId,
696-
title: "Terminal",
697-
kind: "execute",
700+
title: emitEditPermission ? "Delete obsolete file" : "Terminal",
701+
...(emitEditPermission ? {} : { kind: "execute" as const }),
698702
status: "completed",
699703
rawOutput: {
700704
exitCode: 0,

0 commit comments

Comments
 (0)