From 3f27726e10bdd35d98f5fbbae7aab35af94c8436 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Mon, 7 Sep 2026 07:22:44 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B6=20feat:=20Thread=20Conversation=20?= =?UTF-8?q?Code=20Approval=20Through=20Requests=20(#15698)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/data-provider/src/createPayload.ts | 2 ++ packages/data-provider/src/schemas.ts | 2 ++ packages/data-provider/src/types.ts | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/packages/data-provider/src/createPayload.ts b/packages/data-provider/src/createPayload.ts index d52aeab974..5d64a866a8 100644 --- a/packages/data-provider/src/createPayload.ts +++ b/packages/data-provider/src/createPayload.ts @@ -24,6 +24,7 @@ export default function createPayload(submission: t.TSubmission) { ephemeralAgent, endpointOption, manualSkills, + codeApprovalMode, clientRequestId, recoverySteerId, expectedPredecessorCreatedAt, @@ -56,6 +57,7 @@ export default function createPayload(submission: t.TSubmission) { isContinued: !!(isEdited && isContinued), ephemeralAgent: s.isAssistantsEndpoint(endpoint) ? undefined : ephemeralAgent, manualSkills: s.isAssistantsEndpoint(endpoint) ? undefined : manualSkills, + codeApprovalMode: s.isAssistantsEndpoint(endpoint) ? undefined : codeApprovalMode, timezone: getUserTimezone(), clientRequestId, recoverySteerId, diff --git a/packages/data-provider/src/schemas.ts b/packages/data-provider/src/schemas.ts index 7916284858..14f79153f9 100644 --- a/packages/data-provider/src/schemas.ts +++ b/packages/data-provider/src/schemas.ts @@ -4,6 +4,7 @@ import type { SearchResultData } from './types/web'; import type { TFile } from './types/files'; import { userSubmittedMessageFieldPathSchema } from './filters'; import { TFeedback, feedbackSchema } from './feedback'; +import { CODE_APPROVAL_MODES } from './code/approval'; import { Tools } from './types/assistants'; export const isUUID = z.string().uuid(); @@ -1080,6 +1081,7 @@ export const tConversationSchema = z.object({ pinned: z.boolean().optional(), /** Server-derived: an active shared link exists for this conversation. Not persisted. */ isShared: z.boolean().optional(), + codeApprovalMode: z.enum(CODE_APPROVAL_MODES).optional(), title: z.string().nullable().or(z.literal('New Chat')).default('New Chat'), user: z.string().optional(), messages: z.array(z.string()).optional(), diff --git a/packages/data-provider/src/types.ts b/packages/data-provider/src/types.ts index fa0c9fe33d..fe9278d655 100644 --- a/packages/data-provider/src/types.ts +++ b/packages/data-provider/src/types.ts @@ -12,6 +12,7 @@ import type { } from './schemas'; import type { CodeEnvironmentUserConfigSchema, CodeEnvironmentUserSettings } from './config'; import type { Agent, EToolResources, StatefulCodeEnvironment } from './types/assistants'; +import type { CodeApprovalMode } from './code/approval'; import type { RefillIntervalUnit } from './balance'; import type { SettingDefinition } from './generate'; import type { TMinimalFeedback } from './feedback'; @@ -146,6 +147,8 @@ export type TPayload = Partial & * before the LLM turn runs. */ manualSkills?: string[]; + /** Conversation-scoped preference for code tool approval behavior. */ + codeApprovalMode?: CodeApprovalMode; /** Browser IANA timezone (e.g. `America/New_York`) used to resolve local-time prompt variables server-side. */ timezone?: string; /** @@ -222,6 +225,8 @@ export type TSubmission = { addedConvo?: TConversation; /** Skills the user invoked via the `$` popover for this submission. */ manualSkills?: string[]; + /** Conversation-scoped preference for code tool approval behavior. */ + codeApprovalMode?: CodeApprovalMode; /** Stable per-submission idempotency key (uuid) forwarded to the server to dedup retried start-generation requests. */ clientRequestId?: string; /** Client-only carry-through for a receipt-bound queued recovery. */