Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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 +1,5 @@
BACKEND_URL=http://localhost:8000
BACKEND_URL=http://localhost:8000

#for guardrails
GUARDRAILS_URL = http://localhost:8001
GUARDRAILS_TOKEN =
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 | 🟡 Minor

Normalize the new env entries before merging.

This hunk will still trip dotenv-linter because of the spaces around = and the trailing whitespace on GUARDRAILS_TOKEN.

🧹 Suggested cleanup
-#for guardrails
-GUARDRAILS_URL = http://localhost:8001
-GUARDRAILS_TOKEN = 
+# for guardrails
+GUARDRAILS_TOKEN=
+GUARDRAILS_URL=http://localhost:8001
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#for guardrails
GUARDRAILS_URL = http://localhost:8001
GUARDRAILS_TOKEN =
# for guardrails
GUARDRAILS_TOKEN=
GUARDRAILS_URL=http://localhost:8001
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 4-4: [SpaceCharacter] The line has spaces around equal sign

(SpaceCharacter)


[warning] 5-5: [SpaceCharacter] The line has spaces around equal sign

(SpaceCharacter)


[warning] 5-5: [TrailingWhitespace] Trailing whitespace detected

(TrailingWhitespace)


[warning] 5-5: [UnorderedKey] The GUARDRAILS_TOKEN key should go before the GUARDRAILS_URL key

(UnorderedKey)

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

In @.env.example around lines 3 - 5, Normalize the new environment entries by
removing spaces around the equals sign and trimming trailing whitespace so they
conform to dotenv syntax and pass dotenv-linter; specifically update the
GUARDRAILS_URL and GUARDRAILS_TOKEN lines (remove spaces before/after '=' and
delete any trailing spaces on GUARDRAILS_TOKEN) so the variables are defined as
VAR=VALUE with no extra whitespace.

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