[GH-ISSUE #418] [Issue]: Script-type custom tools silently saved with enabled:"false" when CUSTOM_TOOL_SCRIPT_ENABLED is unset, vanish from agent picker #176

Closed
opened 2026-10-20 17:25:55 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @cha1latte on GitHub (May 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/418

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Script-type custom tools silently persist with enabled:"false" when CUSTOM_TOOL_SCRIPT_ENABLED is unset or false in .env, causing them to disappear from the agent tool picker with no UI feedback. The Script execution-type button remains fully interactive in the tool editor regardless, so users can build and "save" tools that can never be selected. Original discord thread.

Expected behavior

Either:

  1. The Script execution-type option in the custom tool editor should be disabled / grayed out with a visible tooltip or banner when CUSTOM_TOOL_SCRIPT_ENABLED is not true (mirroring how other gated v1.5.7 flows behave), or
  2. Saving a script tool with the flag off should surface a clear error/warning in the UI ("Script tools are disabled — set CUSTOM_TOOL_SCRIPT_ENABLED=true in your .env to enable") instead of silently writing the record with enabled:"false".

Either way, the user should not be able to reach a state where a tool exists in storage but is invisible to agents with zero feedback explaining why.

Actual behavior

With CUSTOM_TOOL_SCRIPT_ENABLED unset (the default once a .env file exists), creating or updating any script-type custom tool persists it with enabled:"false". The tool still appears in the Custom Tools list and editor, but is filtered out of the agent tool picker. Static and webhook tools are unaffected. There is no toast, error banner, terminal log (even with debug mode on), or browser console message indicating the tool was saved in a disabled state. Restarting the server does not surface it. Pre-existing script tools created before v1.5.7 work until they are edited, at which point the save path flips them to enabled:"false" and they vanish too.

Steps to reproduce

  1. Install Marinara Engine v1.5.7 fresh (or upgrade) and create a .env file (required for ADMIN_SECRET to edit script tools at all) without setting CUSTOM_TOOL_SCRIPT_ENABLED=true.
  2. Open the custom tool editor and create a tool — name it test_tool, give it any parameter, set Execution Type to Script, and use a trivial body like return {result: "test result"};. Save.
  3. Open any agent's tool list / picker — the tool is missing.
  4. (Confirm root cause) Inspect the persisted tool record; the enabled field is "false". Manually editing it to "true" and reloading the server makes the tool appear in the agent picker.
  5. (Bonus repro) Switch the same tool's execution type back to Static Result and save — it reappears in the picker. Switch it back to Script — it disappears again.

Environment

  • Marinara Engine version: v1.5.7 (Build: 84498fd)
  • Install type: source (git clone, per the Linux instructions on the repo)
  • OS + version: CachyOS (Arch-based Linux)
  • Browser or app shell: standard browser (issue reproduces with browser DevTools console open and silent)

Logs, screenshots, or video

Screenshots attached showing:

  • The tool configured as Static Result → visible in the agent picker as test_tool.
  • The same tool switched to Script (identical name/params, body return {result: "test result"};) → no longer present in the agent picker.
  • The agent tool list before and after the type change for comparison.

Persisted tool record after saving as Script (secrets stripped):

{
  "id":"Z1YusA9t_5Y7kzYxn2Qhi",
  "name":"test_tool",
  "description":"This is a test tool",
  "parametersSchema":"{\"type\":\"object\",\"properties\":{\"test\":{\"type\":\"string\",\"description\":\"test parameter\"}},\"required\":[\"test\"]}",
  "executionType":"script",
  "webhookUrl":null,
  "staticResult":null,
  "scriptBody":"return \"test\";",
  "enabled":"false",
  "createdAt":"2026-05-04T17:57:27.485Z",
  "updatedAt":"2026-05-04T18:29:55.051Z"
}

No relevant output appears in the terminal (with debug mode enabled) or in the browser DevTools console at any point during create / save / agent-picker open.

Additional context

Root cause traced to the CUSTOM_TOOL_SCRIPT_ENABLED env variable introduced in the v1.5.7 security hardening. The flag is documented in the example .env and mentioned in the release notes alongside UPDATES_APPLY_ENABLED and SIDECAR_RUNTIME_INSTALL_ENABLED, but it isn't surfaced anywhere in the UI or in the docs reachable by a user who isn't already troubleshooting. Setting CUSTOM_TOOL_SCRIPT_ENABLED=true in .env and restarting fixes new tool creation; previously-saved tools still need their persisted enabled field corrected manually (or to be re-saved after the flag is set, depending on which path is taken).

Workaround: add CUSTOM_TOOL_SCRIPT_ENABLED=true to .env, restart, and re-save any affected tools (or hand-edit the enabled field on existing records, with a backup first).

The two distinct UX problems this issue covers — both worth addressing even if the env-gating itself is intentional — are:

  1. The Script execution-type button is interactive even when the underlying flow is gated off.
  2. Saves under that condition silently write enabled:"false" with no user-facing signal.

Original Discord thread with full triage: https://discord.com/channels/1417099416812392641/1500923979299291247

Template check

  • I DID NOT read this template and provide the requested details.
Image Image Image Image
Originally created by @cha1latte on GitHub (May 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/418 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Script-type custom tools silently persist with `enabled:"false"` when `CUSTOM_TOOL_SCRIPT_ENABLED` is unset or false in `.env`, causing them to disappear from the agent tool picker with no UI feedback. The Script execution-type button remains fully interactive in the tool editor regardless, so users can build and "save" tools that can never be selected. Original discord thread. ## Expected behavior Either: 1. The Script execution-type option in the custom tool editor should be disabled / grayed out with a visible tooltip or banner when `CUSTOM_TOOL_SCRIPT_ENABLED` is not true (mirroring how other gated v1.5.7 flows behave), **or** 2. Saving a script tool with the flag off should surface a clear error/warning in the UI ("Script tools are disabled — set `CUSTOM_TOOL_SCRIPT_ENABLED=true` in your `.env` to enable") instead of silently writing the record with `enabled:"false"`. Either way, the user should not be able to reach a state where a tool exists in storage but is invisible to agents with zero feedback explaining why. ## Actual behavior With `CUSTOM_TOOL_SCRIPT_ENABLED` unset (the default once a `.env` file exists), creating or updating any script-type custom tool persists it with `enabled:"false"`. The tool still appears in the Custom Tools list and editor, but is filtered out of the agent tool picker. Static and webhook tools are unaffected. There is no toast, error banner, terminal log (even with debug mode on), or browser console message indicating the tool was saved in a disabled state. Restarting the server does not surface it. Pre-existing script tools created before v1.5.7 work until they are edited, at which point the save path flips them to `enabled:"false"` and they vanish too. ## Steps to reproduce 1. Install Marinara Engine v1.5.7 fresh (or upgrade) and create a `.env` file (required for `ADMIN_SECRET` to edit script tools at all) **without** setting `CUSTOM_TOOL_SCRIPT_ENABLED=true`. 2. Open the custom tool editor and create a tool — name it `test_tool`, give it any parameter, set Execution Type to **Script**, and use a trivial body like `return {result: "test result"};`. Save. 3. Open any agent's tool list / picker — the tool is missing. 4. (Confirm root cause) Inspect the persisted tool record; the `enabled` field is `"false"`. Manually editing it to `"true"` and reloading the server makes the tool appear in the agent picker. 5. (Bonus repro) Switch the same tool's execution type back to **Static Result** and save — it reappears in the picker. Switch it back to Script — it disappears again. ## Environment - Marinara Engine version: v1.5.7 (Build: 84498fd) - Install type: source (git clone, per the Linux instructions on the repo) - OS + version: CachyOS (Arch-based Linux) - Browser or app shell: standard browser (issue reproduces with browser DevTools console open and silent) ## Logs, screenshots, or video Screenshots attached showing: - The tool configured as Static Result → visible in the agent picker as `test_tool`. - The same tool switched to Script (identical name/params, body `return {result: "test result"};`) → no longer present in the agent picker. - The agent tool list before and after the type change for comparison. Persisted tool record after saving as Script (secrets stripped): ```json { "id":"Z1YusA9t_5Y7kzYxn2Qhi", "name":"test_tool", "description":"This is a test tool", "parametersSchema":"{\"type\":\"object\",\"properties\":{\"test\":{\"type\":\"string\",\"description\":\"test parameter\"}},\"required\":[\"test\"]}", "executionType":"script", "webhookUrl":null, "staticResult":null, "scriptBody":"return \"test\";", "enabled":"false", "createdAt":"2026-05-04T17:57:27.485Z", "updatedAt":"2026-05-04T18:29:55.051Z" } ``` No relevant output appears in the terminal (with debug mode enabled) or in the browser DevTools console at any point during create / save / agent-picker open. ## Additional context Root cause traced to the `CUSTOM_TOOL_SCRIPT_ENABLED` env variable introduced in the v1.5.7 security hardening. The flag is documented in the example `.env` and mentioned in the release notes alongside `UPDATES_APPLY_ENABLED` and `SIDECAR_RUNTIME_INSTALL_ENABLED`, but it isn't surfaced anywhere in the UI or in the docs reachable by a user who isn't already troubleshooting. Setting `CUSTOM_TOOL_SCRIPT_ENABLED=true` in `.env` and restarting fixes new tool creation; previously-saved tools still need their persisted `enabled` field corrected manually (or to be re-saved after the flag is set, depending on which path is taken). Workaround: add `CUSTOM_TOOL_SCRIPT_ENABLED=true` to `.env`, restart, and re-save any affected tools (or hand-edit the `enabled` field on existing records, with a backup first). The two distinct UX problems this issue covers — both worth addressing even if the env-gating itself is intentional — are: 1. The Script execution-type button is interactive even when the underlying flow is gated off. 2. Saves under that condition silently write `enabled:"false"` with no user-facing signal. Original Discord thread with full triage: https://discord.com/channels/1417099416812392641/1500923979299291247 ## Template check - [ ] I DID NOT read this template and provide the requested details. <img width="1293" height="800" alt="Image" src="https://github.com/user-attachments/assets/145a7202-ce81-437f-befd-55bc86f1ea61" /> <img width="850" height="462" alt="Image" src="https://github.com/user-attachments/assets/a8f7cc2c-c765-492a-ae18-12a00831ce8b" /> <img width="1291" height="883" alt="Image" src="https://github.com/user-attachments/assets/377a56aa-0b20-469b-9a1c-2c467dd1900e" /> <img width="862" height="591" alt="Image" src="https://github.com/user-attachments/assets/5dec62e7-ee23-4666-921c-453950eecce7" />
bsakaguchi 2026-10-20 17:25:55 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (May 5, 2026):

Fixed.

<!-- gh-comment-id:4377847113 --> @SpicyMarinara commented on GitHub (May 5, 2026): Fixed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#176
No description provided.