Skip to content

Commit 4ec6acc

Browse files
authored
Remove legacy agent package code (#479)
1 parent 6034366 commit 4ec6acc

20 files changed

Lines changed: 18 additions & 1983 deletions

File tree

apps/array/src/main/services/agent/schemas.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ export const credentialsSchema = z.object({
99

1010
export type Credentials = z.infer<typeof credentialsSchema>;
1111

12-
// Agent framework schema
13-
export const agentFrameworkSchema = z.enum(["claude", "codex"]);
14-
export type AgentFramework = z.infer<typeof agentFrameworkSchema>;
15-
1612
// Execution mode schema
1713
export const executionModeSchema = z.enum(["plan", "acceptEdits", "default"]);
1814
export type ExecutionMode = z.infer<typeof executionModeSchema>;
@@ -26,7 +22,6 @@ export const sessionConfigSchema = z.object({
2622
logUrl: z.string().optional(),
2723
sdkSessionId: z.string().optional(),
2824
model: z.string().optional(),
29-
framework: agentFrameworkSchema.optional(),
3025
executionMode: executionModeSchema.optional(),
3126
});
3227

@@ -44,7 +39,6 @@ export const startSessionInput = z.object({
4439
permissionMode: z.string().optional(),
4540
autoProgress: z.boolean().optional(),
4641
model: z.string().optional(),
47-
framework: agentFrameworkSchema.optional().default("claude"),
4842
executionMode: z.enum(["plan", "acceptEdits", "default"]).optional(),
4943
runMode: z.enum(["local", "cloud"]).optional(),
5044
createPR: z.boolean().optional(),

apps/array/src/main/services/agent/service.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ interface SessionConfig {
129129
logUrl?: string;
130130
sdkSessionId?: string;
131131
model?: string;
132-
framework?: "claude" | "codex";
133132
executionMode?: "plan" | "acceptEdits" | "default";
134133
}
135134

@@ -318,7 +317,6 @@ export class AgentService extends TypedEventEmitter<AgentServiceEvents> {
318317
logUrl,
319318
sdkSessionId,
320319
model,
321-
framework,
322320
executionMode,
323321
} = config;
324322

@@ -345,7 +343,6 @@ export class AgentService extends TypedEventEmitter<AgentServiceEvents> {
345343
try {
346344
const { clientStreams } = await agent.runTaskV2(taskId, taskRunId, {
347345
skipGitBranch: true,
348-
framework,
349346
isReconnect,
350347
});
351348

@@ -790,7 +787,6 @@ export class AgentService extends TypedEventEmitter<AgentServiceEvents> {
790787
logUrl: "logUrl" in params ? params.logUrl : undefined,
791788
sdkSessionId: "sdkSessionId" in params ? params.sdkSessionId : undefined,
792789
model: "model" in params ? params.model : undefined,
793-
framework: "framework" in params ? params.framework : "claude",
794790
executionMode:
795791
"executionMode" in params ? params.executionMode : undefined,
796792
};

apps/array/src/renderer/features/sessions/components/FrameworkSelector.tsx

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

apps/array/src/renderer/features/sessions/stores/sessionStore.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface AgentSession {
5151
logUrl?: string;
5252
processedLineCount?: number;
5353
model?: string;
54-
framework?: "claude" | "codex";
54+
framework?: "claude";
5555
// Current execution mode (plan = read-only, default = manual approve, acceptEdits = auto-approve edits)
5656
currentMode: ExecutionMode;
5757
// Permission requests waiting for user response
@@ -416,7 +416,6 @@ function createBaseSession(
416416
taskRunId: string,
417417
taskId: string,
418418
isCloud: boolean,
419-
framework?: "claude" | "codex",
420419
executionMode?: "plan" | "acceptEdits",
421420
): AgentSession {
422421
return {
@@ -428,7 +427,6 @@ function createBaseSession(
428427
status: "connecting",
429428
isPromptPending: false,
430429
isCloud,
431-
framework,
432430
currentMode: executionMode ?? "default",
433431
pendingPermissions: new Map(),
434432
};
@@ -667,7 +665,7 @@ const useStore = create<SessionStore>()(
667665
const persistedMode = getPersistedTaskMode(taskId);
668666
const effectiveMode = executionMode ?? persistedMode;
669667

670-
const { defaultModel, defaultFramework } = useSettingsStore.getState();
668+
const { defaultModel } = useSettingsStore.getState();
671669
const result = await trpcVanilla.agent.start.mutate({
672670
taskId,
673671
taskRunId: taskRun.id,
@@ -676,15 +674,13 @@ const useStore = create<SessionStore>()(
676674
apiHost: auth.apiHost,
677675
projectId: auth.projectId,
678676
model: defaultModel,
679-
framework: defaultFramework,
680677
executionMode: effectiveMode,
681678
});
682679

683680
const session = createBaseSession(
684681
taskRun.id,
685682
taskId,
686683
false,
687-
defaultFramework,
688684
effectiveMode === "default" ? undefined : effectiveMode,
689685
);
690686
session.channel = result.channel;
@@ -701,7 +697,6 @@ const useStore = create<SessionStore>()(
701697
task_id: taskId,
702698
execution_type: "local",
703699
model: defaultModel,
704-
framework: defaultFramework,
705700
});
706701

707702
if (initialPrompt?.length) {

apps/array/src/renderer/features/settings/stores/settingsStore.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import type { WorkspaceMode } from "@shared/types";
2-
import {
3-
type AgentFramework,
4-
DEFAULT_FRAMEWORK,
5-
DEFAULT_MODEL,
6-
} from "@shared/types/models";
2+
import { DEFAULT_MODEL } from "@shared/types/models";
73
import { create } from "zustand";
84
import { persist } from "zustand/middleware";
95

@@ -18,7 +14,6 @@ interface SettingsStore {
1814
lastUsedWorkspaceMode: WorkspaceMode;
1915
createPR: boolean;
2016
defaultModel: string;
21-
defaultFramework: AgentFramework;
2217
desktopNotifications: boolean;
2318

2419
setAutoRunTasks: (autoRun: boolean) => void;
@@ -28,7 +23,6 @@ interface SettingsStore {
2823
setLastUsedWorkspaceMode: (mode: WorkspaceMode) => void;
2924
setCreatePR: (createPR: boolean) => void;
3025
setDefaultModel: (model: string) => void;
31-
setDefaultFramework: (framework: AgentFramework) => void;
3226
setDesktopNotifications: (enabled: boolean) => void;
3327
}
3428

@@ -42,7 +36,6 @@ export const useSettingsStore = create<SettingsStore>()(
4236
lastUsedWorkspaceMode: "worktree",
4337
createPR: true,
4438
defaultModel: DEFAULT_MODEL,
45-
defaultFramework: DEFAULT_FRAMEWORK,
4639
desktopNotifications: true,
4740

4841
setAutoRunTasks: (autoRun) => set({ autoRunTasks: autoRun }),
@@ -53,7 +46,6 @@ export const useSettingsStore = create<SettingsStore>()(
5346
setLastUsedWorkspaceMode: (mode) => set({ lastUsedWorkspaceMode: mode }),
5447
setCreatePR: (createPR) => set({ createPR }),
5548
setDefaultModel: (model) => set({ defaultModel: model }),
56-
setDefaultFramework: (framework) => set({ defaultFramework: framework }),
5749
setDesktopNotifications: (enabled) =>
5850
set({ desktopNotifications: enabled }),
5951
}),

apps/array/src/renderer/features/task-detail/components/TaskInputEditor.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { EditorToolbar } from "@features/message-editor/components/EditorToolbar
33
import type { MessageEditorHandle } from "@features/message-editor/components/MessageEditor";
44
import { ModeIndicatorInput } from "@features/message-editor/components/ModeIndicatorInput";
55
import { useTiptapEditor } from "@features/message-editor/tiptap/useTiptapEditor";
6-
import { FrameworkSelector } from "@features/sessions/components/FrameworkSelector";
76
import type { ExecutionMode } from "@features/sessions/stores/sessionStore";
87
import { ArrowUp, GitBranchIcon } from "@phosphor-icons/react";
98
import { Box, Flex, IconButton, Text, Tooltip } from "@radix-ui/themes";
@@ -195,15 +194,12 @@ export const TaskInputEditor = forwardRef<
195194
</Flex>
196195

197196
<Flex justify="between" align="center" px="3" pb="3">
198-
<Flex align="center" gap="1">
199-
<EditorToolbar
200-
disabled={isCreatingTask}
201-
onInsertChip={insertChip}
202-
attachTooltip="Attach files from anywhere"
203-
iconSize={16}
204-
/>
205-
<FrameworkSelector disabled={isCreatingTask} />
206-
</Flex>
197+
<EditorToolbar
198+
disabled={isCreatingTask}
199+
onInsertChip={insertChip}
200+
attachTooltip="Attach files from anywhere"
201+
iconSize={16}
202+
/>
207203

208204
<Flex align="center" gap="4">
209205
{!isCloudMode && (

apps/array/src/shared/types/models.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,29 +66,7 @@ export const AVAILABLE_MODELS: ModelOption[] = [
6666
export const DEFAULT_MODEL = "claude-opus-4-5";
6767

6868
// Agent frameworks
69-
export type AgentFramework = "claude" | "codex";
70-
71-
export interface FrameworkOption {
72-
id: AgentFramework;
73-
name: string;
74-
description: string;
75-
enabled: boolean;
76-
}
77-
78-
export const AVAILABLE_FRAMEWORKS: FrameworkOption[] = [
79-
{
80-
id: "claude",
81-
name: "Claude Code",
82-
description: "Anthropic's Claude Code agent",
83-
enabled: true,
84-
},
85-
{
86-
id: "codex",
87-
name: "OpenAI Codex",
88-
description: "OpenAI's Codex agent",
89-
enabled: true,
90-
},
91-
];
69+
export type AgentFramework = "claude";
9270

9371
export const DEFAULT_FRAMEWORK: AgentFramework = "claude";
9472

apps/array/src/types/analytics.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export type GitActionType =
1414
| "create-pr";
1515
export type FileOpenSource = "sidebar" | "agent-suggestion" | "search" | "diff";
1616
export type FileChangeType = "added" | "modified" | "deleted";
17-
export type AgentFramework = "claude" | "codex";
1817
export type StopReason = "user_cancelled" | "completed" | "error" | "timeout";
1918
export type CommandMenuAction =
2019
| "home"
@@ -62,7 +61,6 @@ export interface TaskRunStartedProperties {
6261
task_id: string;
6362
execution_type: ExecutionType;
6463
model?: string;
65-
framework?: AgentFramework;
6664
}
6765

6866
export interface TaskRunCompletedProperties {

packages/agent/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@posthog/agent",
3-
"version": "1.30.0",
3+
"version": "2.0.0",
44
"repository": "https://github.com/PostHog/array",
55
"description": "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
66
"main": "./dist/index.js",
@@ -45,7 +45,6 @@
4545
"dependencies": {
4646
"@agentclientprotocol/sdk": "^0.5.1",
4747
"@anthropic-ai/claude-agent-sdk": "^0.1.55",
48-
"@openai/codex-sdk": "0.60.1",
4948
"@anthropic-ai/sdk": "^0.71.0",
5049
"@modelcontextprotocol/sdk": "^1.23.0",
5150
"diff": "^8.0.2",

packages/agent/src/adapters/claude/claude.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,5 @@ export function streamEventToAcpNotifications(
19431943
}
19441944

19451945
// Note: createAcpConnection has been moved to ../connection.ts
1946-
// to support multiple agent frameworks (Claude, Codex).
19471946
// Import from there instead:
19481947
// import { createAcpConnection } from "../connection.js";

0 commit comments

Comments
 (0)