Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions apps/array/src/main/services/agent/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ export const credentialsSchema = z.object({

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

// Agent framework schema
export const agentFrameworkSchema = z.enum(["claude", "codex"]);
export type AgentFramework = z.infer<typeof agentFrameworkSchema>;

// Execution mode schema
export const executionModeSchema = z.enum(["plan", "acceptEdits", "default"]);
export type ExecutionMode = z.infer<typeof executionModeSchema>;
Expand All @@ -26,7 +22,6 @@ export const sessionConfigSchema = z.object({
logUrl: z.string().optional(),
sdkSessionId: z.string().optional(),
model: z.string().optional(),
framework: agentFrameworkSchema.optional(),
executionMode: executionModeSchema.optional(),
});

Expand All @@ -44,7 +39,6 @@ export const startSessionInput = z.object({
permissionMode: z.string().optional(),
autoProgress: z.boolean().optional(),
model: z.string().optional(),
framework: agentFrameworkSchema.optional().default("claude"),
executionMode: z.enum(["plan", "acceptEdits", "default"]).optional(),
runMode: z.enum(["local", "cloud"]).optional(),
createPR: z.boolean().optional(),
Expand Down
4 changes: 0 additions & 4 deletions apps/array/src/main/services/agent/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ interface SessionConfig {
logUrl?: string;
sdkSessionId?: string;
model?: string;
framework?: "claude" | "codex";
executionMode?: "plan" | "acceptEdits" | "default";
}

Expand Down Expand Up @@ -318,7 +317,6 @@ export class AgentService extends TypedEventEmitter<AgentServiceEvents> {
logUrl,
sdkSessionId,
model,
framework,
executionMode,
} = config;

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

Expand Down Expand Up @@ -790,7 +787,6 @@ export class AgentService extends TypedEventEmitter<AgentServiceEvents> {
logUrl: "logUrl" in params ? params.logUrl : undefined,
sdkSessionId: "sdkSessionId" in params ? params.sdkSessionId : undefined,
model: "model" in params ? params.model : undefined,
framework: "framework" in params ? params.framework : "claude",
executionMode:
"executionMode" in params ? params.executionMode : undefined,
};
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface AgentSession {
logUrl?: string;
processedLineCount?: number;
model?: string;
framework?: "claude" | "codex";
framework?: "claude";
// Current execution mode (plan = read-only, default = manual approve, acceptEdits = auto-approve edits)
currentMode: ExecutionMode;
// Permission requests waiting for user response
Expand Down Expand Up @@ -416,7 +416,6 @@ function createBaseSession(
taskRunId: string,
taskId: string,
isCloud: boolean,
framework?: "claude" | "codex",
executionMode?: "plan" | "acceptEdits",
): AgentSession {
return {
Expand All @@ -428,7 +427,6 @@ function createBaseSession(
status: "connecting",
isPromptPending: false,
isCloud,
framework,
currentMode: executionMode ?? "default",
pendingPermissions: new Map(),
};
Expand Down Expand Up @@ -667,7 +665,7 @@ const useStore = create<SessionStore>()(
const persistedMode = getPersistedTaskMode(taskId);
const effectiveMode = executionMode ?? persistedMode;

const { defaultModel, defaultFramework } = useSettingsStore.getState();
const { defaultModel } = useSettingsStore.getState();
const result = await trpcVanilla.agent.start.mutate({
taskId,
taskRunId: taskRun.id,
Expand All @@ -676,15 +674,13 @@ const useStore = create<SessionStore>()(
apiHost: auth.apiHost,
projectId: auth.projectId,
model: defaultModel,
framework: defaultFramework,
executionMode: effectiveMode,
});

const session = createBaseSession(
taskRun.id,
taskId,
false,
defaultFramework,
effectiveMode === "default" ? undefined : effectiveMode,
);
session.channel = result.channel;
Expand All @@ -701,7 +697,6 @@ const useStore = create<SessionStore>()(
task_id: taskId,
execution_type: "local",
model: defaultModel,
framework: defaultFramework,
});

if (initialPrompt?.length) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import type { WorkspaceMode } from "@shared/types";
import {
type AgentFramework,
DEFAULT_FRAMEWORK,
DEFAULT_MODEL,
} from "@shared/types/models";
import { DEFAULT_MODEL } from "@shared/types/models";
import { create } from "zustand";
import { persist } from "zustand/middleware";

Expand All @@ -18,7 +14,6 @@ interface SettingsStore {
lastUsedWorkspaceMode: WorkspaceMode;
createPR: boolean;
defaultModel: string;
defaultFramework: AgentFramework;
desktopNotifications: boolean;

setAutoRunTasks: (autoRun: boolean) => void;
Expand All @@ -28,7 +23,6 @@ interface SettingsStore {
setLastUsedWorkspaceMode: (mode: WorkspaceMode) => void;
setCreatePR: (createPR: boolean) => void;
setDefaultModel: (model: string) => void;
setDefaultFramework: (framework: AgentFramework) => void;
setDesktopNotifications: (enabled: boolean) => void;
}

Expand All @@ -42,7 +36,6 @@ export const useSettingsStore = create<SettingsStore>()(
lastUsedWorkspaceMode: "worktree",
createPR: true,
defaultModel: DEFAULT_MODEL,
defaultFramework: DEFAULT_FRAMEWORK,
desktopNotifications: true,

setAutoRunTasks: (autoRun) => set({ autoRunTasks: autoRun }),
Expand All @@ -53,7 +46,6 @@ export const useSettingsStore = create<SettingsStore>()(
setLastUsedWorkspaceMode: (mode) => set({ lastUsedWorkspaceMode: mode }),
setCreatePR: (createPR) => set({ createPR }),
setDefaultModel: (model) => set({ defaultModel: model }),
setDefaultFramework: (framework) => set({ defaultFramework: framework }),
setDesktopNotifications: (enabled) =>
set({ desktopNotifications: enabled }),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { EditorToolbar } from "@features/message-editor/components/EditorToolbar
import type { MessageEditorHandle } from "@features/message-editor/components/MessageEditor";
import { ModeIndicatorInput } from "@features/message-editor/components/ModeIndicatorInput";
import { useTiptapEditor } from "@features/message-editor/tiptap/useTiptapEditor";
import { FrameworkSelector } from "@features/sessions/components/FrameworkSelector";
import type { ExecutionMode } from "@features/sessions/stores/sessionStore";
import { ArrowUp, GitBranchIcon } from "@phosphor-icons/react";
import { Box, Flex, IconButton, Text, Tooltip } from "@radix-ui/themes";
Expand Down Expand Up @@ -195,15 +194,12 @@ export const TaskInputEditor = forwardRef<
</Flex>

<Flex justify="between" align="center" px="3" pb="3">
<Flex align="center" gap="1">
<EditorToolbar
disabled={isCreatingTask}
onInsertChip={insertChip}
attachTooltip="Attach files from anywhere"
iconSize={16}
/>
<FrameworkSelector disabled={isCreatingTask} />
</Flex>
<EditorToolbar
disabled={isCreatingTask}
onInsertChip={insertChip}
attachTooltip="Attach files from anywhere"
iconSize={16}
/>

<Flex align="center" gap="4">
{!isCloudMode && (
Expand Down
24 changes: 1 addition & 23 deletions apps/array/src/shared/types/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,7 @@ export const AVAILABLE_MODELS: ModelOption[] = [
export const DEFAULT_MODEL = "claude-opus-4-5";

// Agent frameworks
export type AgentFramework = "claude" | "codex";

export interface FrameworkOption {
id: AgentFramework;
name: string;
description: string;
enabled: boolean;
}

export const AVAILABLE_FRAMEWORKS: FrameworkOption[] = [
{
id: "claude",
name: "Claude Code",
description: "Anthropic's Claude Code agent",
enabled: true,
},
{
id: "codex",
name: "OpenAI Codex",
description: "OpenAI's Codex agent",
enabled: true,
},
];
export type AgentFramework = "claude";

export const DEFAULT_FRAMEWORK: AgentFramework = "claude";

Expand Down
2 changes: 0 additions & 2 deletions apps/array/src/types/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export type GitActionType =
| "create-pr";
export type FileOpenSource = "sidebar" | "agent-suggestion" | "search" | "diff";
export type FileChangeType = "added" | "modified" | "deleted";
export type AgentFramework = "claude" | "codex";
export type StopReason = "user_cancelled" | "completed" | "error" | "timeout";
export type CommandMenuAction =
| "home"
Expand Down Expand Up @@ -62,7 +61,6 @@ export interface TaskRunStartedProperties {
task_id: string;
execution_type: ExecutionType;
model?: string;
framework?: AgentFramework;
}

export interface TaskRunCompletedProperties {
Expand Down
3 changes: 1 addition & 2 deletions packages/agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@posthog/agent",
"version": "1.30.0",
"version": "2.0.0",
"repository": "https://github.com/PostHog/array",
"description": "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
"main": "./dist/index.js",
Expand Down Expand Up @@ -45,7 +45,6 @@
"dependencies": {
"@agentclientprotocol/sdk": "^0.5.1",
"@anthropic-ai/claude-agent-sdk": "^0.1.55",
"@openai/codex-sdk": "0.60.1",
"@anthropic-ai/sdk": "^0.71.0",
"@modelcontextprotocol/sdk": "^1.23.0",
"diff": "^8.0.2",
Expand Down
1 change: 0 additions & 1 deletion packages/agent/src/adapters/claude/claude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,5 @@ export function streamEventToAcpNotifications(
}

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