@@ -1421,6 +1592,33 @@ function PlaygroundConfigSection({
)}
+ {/* Code: runtime picker in section header (like the model picker). */}
+ {fieldKey === "code" && (
+
e.stopPropagation()}
+ className="flex items-center gap-2 flex-shrink-0"
+ >
+ ({
+ key: o.value,
+ label: o.label,
+ })),
+ selectedKeys: codeRuntime ? [codeRuntime] : [],
+ onClick: ({key}) => handleRuntimeChange(key),
+ }}
+ >
+
+
+
+ )}
+
{/* Feedback config: Advanced Mode toggle in section header */}
{fieldKey === "feedback_config" && (
+
+ {fieldKey === "schemas" ? (
+ }
+ onChange={(next) => props.onChange(next)}
+ disabled={disabled}
+ />
+ ) : fieldKey === "hook" ? (
+ }
+ onChange={(next) => props.onChange(next)}
+ disabled={disabled}
+ />
+ ) : (
+ }
+ onChange={(next) => props.onChange(next)}
+ disabled={disabled}
+ />
+ )}
+
+
+ )
+ }
+
+ // Scalar/array params render directly, without HeightCollapse.
const fieldValue = parameters[fieldKey]
if (
fieldValue === null ||
@@ -1486,19 +1720,17 @@ function PlaygroundConfigSection({
return
{props.defaultRender()}
}
- const isCollapsed = !!collapsedSections[fieldKey]
-
return (
{props.defaultRender()}
)
},
- [collapsedSections, parameters, promptModelInfo?.isRootLevel],
+ [collapsedSections, parameters, siblingGroups, disabled, promptModelInfo?.isRootLevel],
)
// ========== LOADING / EMPTY STATE ==========
- const isConfigLoading = schemaQuery.isPending && !hasParameters(activeData)
+ const isConfigLoading = schemaQuery.isPending && !hasRenderableConfigSections(activeData)
if (isConfigLoading) {
return (
@@ -1510,7 +1742,7 @@ function PlaygroundConfigSection({
)
}
- if (!hasParameters(activeData)) {
+ if (!hasRenderableConfigSections(activeData)) {
return (
| null,
- serverConfig: Record | null,
+ localData: Record | null,
+ remoteData: Record | null,
version: number | undefined,
isLocalDraft: boolean,
): CommitContext {
const currentVersion = version ?? 0
const targetVersion = currentVersion + 1
- const normalizedCurrentConfig =
- (syncPromptInputKeysInParameters(currentConfig) as Record | null) ??
- currentConfig
+ // Diff the whole data object; parameters keep metadata-strip + input-key sync.
+ const buildSide = (data: Record | null, syncParams: boolean) => {
+ const d = data ?? {}
+ const params = (d.parameters as Record | null) ?? {}
+ const normalizedParams = syncParams
+ ? ((syncPromptInputKeysInParameters(params) as Record | null) ??
+ params)
+ : params
+ return {...d, parameters: stripAgentaMetadataDeep(normalizedParams)}
+ }
- const original = stableStringify({parameters: stripAgentaMetadataDeep(serverConfig ?? {})})
- const modified = stableStringify({
- parameters: stripAgentaMetadataDeep(normalizedCurrentConfig ?? {}),
- })
+ const original = stableStringify(buildSide(remoteData, false))
+ const modified = stableStringify(buildSide(localData, true))
const hasDiff = original !== modified
const descriptions: string[] = []
@@ -105,16 +110,15 @@ function buildGenericCommitContext(
const variantCommitContextAtom = (revisionId: string, _metadata?: Record) =>
atom((get): CommitContext | null => {
const isLocalDraft = isLocalDraftId(revisionId)
- const workflowData = get(workflowMolecule.selectors.data(revisionId))
- const currentConfig = get(workflowMolecule.selectors.configuration(revisionId))
- const serverConfig = get(workflowMolecule.selectors.serverConfiguration(revisionId))
+ const localData = get(workflowMolecule.selectors.data(revisionId))
+ const remoteData = get(workflowMolecule.selectors.serverData(revisionId))
- if (!workflowData) return null
+ if (!localData) return null
return buildGenericCommitContext(
- currentConfig,
- serverConfig,
- workflowData.version ?? undefined,
+ (localData.data as Record | null) ?? null,
+ (remoteData?.data as Record | null) ?? null,
+ localData.version ?? undefined,
isLocalDraft,
)
})