Skip to content
Open
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: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com

GUARDRAILS_URL = http://localhost:8001
GUARDRAILS_TOKEN =

NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
14 changes: 0 additions & 14 deletions app/(main)/coming-soon/guardrails/page.tsx

This file was deleted.

7 changes: 7 additions & 0 deletions app/(main)/configurations/prompt-editor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ function PromptEditorContent() {
}),
},
},
...(currentConfigBlob.input_guardrails?.length && {
input_guardrails: currentConfigBlob.input_guardrails,
}),
...(currentConfigBlob.output_guardrails?.length && {
output_guardrails: currentConfigBlob.output_guardrails,
}),
Comment on lines +297 to +302
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Loading an existing config still strips guardrails on the next save.

These fields are written out here now, but applyConfig on Lines 96-111 still rebuilds currentConfigBlob with only completion. Opening a version that already has guardrails and then saving any other change will silently drop them.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/`(main)/configurations/prompt-editor/page.tsx around lines 297 - 302,
applyConfig currently rebuilds currentConfigBlob using only the completion
field, which drops existing input_guardrails and output_guardrails when saving;
update applyConfig to preserve those fields by either spreading the existing
currentConfigBlob or explicitly including input_guardrails:
currentConfigBlob.input_guardrails (when truthy) and output_guardrails:
currentConfigBlob.output_guardrails (when truthy) alongside completion so
loading an existing config doesn't remove guardrails on save.

};

const existingConfigMeta = allConfigMeta.find(
Expand Down Expand Up @@ -502,6 +508,7 @@ function PromptEditorContent() {
isSaving={isSaving}
collapsed={!showConfigPane}
onToggle={() => setShowConfigPane(!showConfigPane)}
apiKey={activeKey?.key ?? ""}
/>
</div>
</div>
Expand Down
Loading
Loading