Skip to content

Commit b3ca06f

Browse files
committed
Revert "fix(infra): rename dev pg container name"
This reverts commit c5354e3.
1 parent a9b5564 commit b3ca06f

9 files changed

Lines changed: 251 additions & 658 deletions

File tree

‎docker-compose.dev.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
services:
1616
postgres:
1717
image: postgres:16-alpine
18-
container_name: agent_control_postgres_dev
18+
container_name: agent_control_postgres
1919
ports:
2020
- "${AGENT_CONTROL_DB_HOST_PORT:-5432}:5432"
2121
environment:

‎ui/src/core/page-components/agent-detail/modals/add-new-control/index.tsx‎

Lines changed: 34 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,6 @@ function getDefaultConfigForEvaluator(
5151
return DEFAULT_EVALUATOR_CONFIGS[evaluatorId] ?? {};
5252
}
5353

54-
function buildJsonDraftControl(agentName: string) {
55-
return {
56-
id: 0,
57-
name: `json-control-for-${sanitizeControlNamePart(agentName)}`,
58-
control: {
59-
description: '',
60-
enabled: true,
61-
execution: 'server' as const,
62-
scope: {
63-
step_types: ['llm'],
64-
stages: ['post'] as ('post' | 'pre')[],
65-
},
66-
condition: {
67-
selector: {
68-
path: '*',
69-
},
70-
evaluator: {
71-
name: 'regex',
72-
config: getDefaultConfigForEvaluator('regex'),
73-
},
74-
},
75-
action: { decision: 'deny' as const },
76-
tags: [],
77-
},
78-
};
79-
}
80-
8154
type AddNewControlModalProps = {
8255
opened: boolean;
8356
onClose: () => void;
@@ -117,12 +90,6 @@ export function AddNewControlModal({
11790
});
11891
};
11992

120-
const handleFromJsonClick = () => {
121-
openModal(MODAL_NAMES.CONTROL_STORE, {
122-
submodal: SUBMODAL_NAMES.CREATE,
123-
});
124-
};
125-
12693
const handleEditModalClose = () => {
12794
closeSubmodal();
12895
};
@@ -143,34 +110,31 @@ export function AddNewControlModal({
143110
}, [evaluatorsData]);
144111

145112
const draftControl = useMemo(() => {
146-
if (selectedEvaluator) {
147-
const name = `${sanitizeControlNamePart(selectedEvaluator.name)}-control-for-${sanitizeControlNamePart(agentName)}`;
148-
return {
149-
id: 0,
150-
name,
151-
control: {
152-
description: selectedEvaluator.description,
153-
enabled: true,
154-
execution: 'server' as const,
155-
scope: {
156-
step_types: ['llm'],
157-
stages: ['post'] as ('post' | 'pre')[],
113+
if (!selectedEvaluator) return null;
114+
const name = `${sanitizeControlNamePart(selectedEvaluator.name)}-control-for-${sanitizeControlNamePart(agentName)}`;
115+
return {
116+
id: 0,
117+
name,
118+
control: {
119+
description: selectedEvaluator.description,
120+
enabled: true,
121+
execution: 'server' as const,
122+
scope: {
123+
step_types: ['llm'],
124+
stages: ['post'] as ('post' | 'pre')[],
125+
},
126+
condition: {
127+
selector: {
128+
path: '*',
158129
},
159-
condition: {
160-
selector: {
161-
path: '*',
162-
},
163-
evaluator: {
164-
name: selectedEvaluator.id,
165-
config: getDefaultConfigForEvaluator(selectedEvaluator.id),
166-
},
130+
evaluator: {
131+
name: selectedEvaluator.id,
132+
config: getDefaultConfigForEvaluator(selectedEvaluator.id),
167133
},
168-
action: { decision: 'deny' as const },
169134
},
170-
};
171-
}
172-
173-
return buildJsonDraftControl(agentName);
135+
action: { decision: 'deny' as const },
136+
},
137+
};
174138
}, [selectedEvaluator, agentName]);
175139

176140
const columns: ColumnDef<EvaluatorInfo & { id: string }>[] = [
@@ -255,7 +219,7 @@ export function AddNewControlModal({
255219
</Button>
256220
</Group>
257221
<Text size="sm" c="dimmed">
258-
Select an evaluator to create a new control or start from JSON
222+
Select an evaluator to create a new control
259223
</Text>
260224
</Box>
261225
<Divider />
@@ -276,30 +240,20 @@ export function AddNewControlModal({
276240
value={searchQuery}
277241
onChange={(e) => setSearchQuery(e.target.value)}
278242
/>
279-
<Group gap="md" wrap="nowrap">
280-
<Button
281-
variant="outline"
243+
<Text size="sm" c="dimmed">
244+
Learn here on how to add new type of evaluator.{' '}
245+
<Text
246+
component="a"
247+
href="https://github.com/agentcontrol/agent-control/blob/main/README.md"
248+
c="blue"
282249
size="sm"
283-
data-testid="from-json-button"
284-
onClick={handleFromJsonClick}
250+
td="none"
251+
target="_blank"
252+
rel="noreferrer"
285253
>
286-
From JSON
287-
</Button>
288-
<Text size="sm" c="dimmed">
289-
Learn here on how to add new type of evaluator.{' '}
290-
<Text
291-
component="a"
292-
href="https://github.com/agentcontrol/agent-control/blob/main/README.md"
293-
c="blue"
294-
size="sm"
295-
td="none"
296-
target="_blank"
297-
rel="noreferrer"
298-
>
299-
Docs ↗
300-
</Text>
254+
Docs ↗
301255
</Text>
302-
</Group>
256+
</Text>
303257
</Group>
304258

305259
{/* Table or Empty State */}
@@ -353,7 +307,6 @@ export function AddNewControlModal({
353307
control={draftControl}
354308
agentId={agentId}
355309
mode="create"
356-
initialEditorMode={selectedEvaluator ? 'form' : 'json'}
357310
onClose={handleEditModalClose}
358311
onSuccess={handleEditModalSuccess}
359312
/>

‎ui/src/core/page-components/agent-detail/modals/edit-control/control-condition.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import type { ControlDefinition } from '@/core/api/types';
22
import type { AnyEvaluatorDefinition } from '@/core/evaluators';
33
import { getEvaluator } from '@/core/evaluators';
44

5+
const COMPOSITE_CONDITION_EDITING_MESSAGE =
6+
'This control uses a composite condition tree. This PR keeps the old single-condition UI, so saving will preserve the existing tree without editing it.';
7+
58
export type LeafConditionDetails = {
69
selectorPath: string;
710
evaluatorName: string;
@@ -13,6 +16,7 @@ export type ControlConditionState = {
1316
evaluatorId: string;
1417
evaluator: AnyEvaluatorDefinition | undefined;
1518
canEditLeafCondition: boolean;
19+
conditionEditingMessage: string | null;
1620
};
1721

1822
function getLeafConditionDetails(
@@ -42,6 +46,9 @@ export function getControlConditionState(
4246
evaluatorId,
4347
evaluator,
4448
canEditLeafCondition: Boolean(leafCondition),
49+
conditionEditingMessage: leafCondition
50+
? null
51+
: COMPOSITE_CONDITION_EDITING_MESSAGE,
4552
};
4653
}
4754

0 commit comments

Comments
 (0)