[GH-ISSUE #2015] Custom tools saved with boolean enabled are hidden from selectors #987

Closed
opened 2026-10-21 05:24:51 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2015

Originally assigned to: @Xelvanis on GitHub.

Problem

New refactor custom tools are saved with enabled: true as a boolean:

  • src/engine/contracts/schemas/custom-tool.schema.ts defaults enabled to true.
  • src/features/catalog/agents/components/ToolEditor.tsx sends enabled: true on save.
  • src-tauri/src/commands/storage/contracts.rs only marks parametersSchema as typed JSON for custom-tools, so enabled is not normalized to the legacy string shape.

The selector helper filters custom tools with a string-only check:

  • src/features/catalog/agents/hooks/use-custom-tools.ts treats a tool as enabled only when tool.enabled === "true" || tool.enabled === "1".

That means a newly saved static or webhook custom tool can be valid and executable in runtime, but hidden from the Chat Settings and Agent tool pickers because its enabled value is boolean true instead of string "true".

Evidence

A local module probe against the refactor branch returned:

{
  "staticToolEnabled": true,
  "selectable": {
    "booleanEnabled": false,
    "stringEnabled": true
  }
}

Runtime paths already accept boolish enabled values:

  • src/engine/generation/tools-runtime.ts uses boolish(row.enabled, false).
  • src-tauri/src/commands/storage/custom_tools.rs uses string_bool(row.get("enabled")) and accepts booleans.

Legacy stored custom-tool enabled as a string through packages/server/src/services/storage/custom-tools.storage.ts, so the old UI string check matched the persisted shape.

Expected behavior

Custom tool UI selection should accept both current refactor booleans and legacy string rows, or storage should normalize custom-tools.enabled consistently.

Acceptance criteria

  • Newly created static custom tools are selectable immediately.
  • Newly created webhook custom tools are selectable immediately when they have a URL.
  • Legacy rows with enabled: "true" or enabled: "1" remain selectable.
  • Disabled rows using boolean false, string "false", or string "0" remain hidden.
  • Focused proof covers isCustomToolSelectable for boolean and string enabled values.

Context

Found during the Target 1 contracts-and-schemas batch-3 parityscan in #2011.

Originally created by @Xelvanis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2015 Originally assigned to: @Xelvanis on GitHub. ## Problem New refactor custom tools are saved with `enabled: true` as a boolean: - `src/engine/contracts/schemas/custom-tool.schema.ts` defaults `enabled` to `true`. - `src/features/catalog/agents/components/ToolEditor.tsx` sends `enabled: true` on save. - `src-tauri/src/commands/storage/contracts.rs` only marks `parametersSchema` as typed JSON for `custom-tools`, so `enabled` is not normalized to the legacy string shape. The selector helper filters custom tools with a string-only check: - `src/features/catalog/agents/hooks/use-custom-tools.ts` treats a tool as enabled only when `tool.enabled === "true" || tool.enabled === "1"`. That means a newly saved static or webhook custom tool can be valid and executable in runtime, but hidden from the Chat Settings and Agent tool pickers because its `enabled` value is boolean `true` instead of string `"true"`. ## Evidence A local module probe against the refactor branch returned: ```json { "staticToolEnabled": true, "selectable": { "booleanEnabled": false, "stringEnabled": true } } ``` Runtime paths already accept boolish enabled values: - `src/engine/generation/tools-runtime.ts` uses `boolish(row.enabled, false)`. - `src-tauri/src/commands/storage/custom_tools.rs` uses `string_bool(row.get("enabled"))` and accepts booleans. Legacy stored custom-tool `enabled` as a string through `packages/server/src/services/storage/custom-tools.storage.ts`, so the old UI string check matched the persisted shape. ## Expected behavior Custom tool UI selection should accept both current refactor booleans and legacy string rows, or storage should normalize `custom-tools.enabled` consistently. ## Acceptance criteria - Newly created static custom tools are selectable immediately. - Newly created webhook custom tools are selectable immediately when they have a URL. - Legacy rows with `enabled: "true"` or `enabled: "1"` remain selectable. - Disabled rows using boolean `false`, string `"false"`, or string `"0"` remain hidden. - Focused proof covers `isCustomToolSelectable` for boolean and string enabled values. ## Context Found during the Target 1 contracts-and-schemas batch-3 parityscan in #2011.
bsakaguchi 2026-10-21 05:24:51 +07:00
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#987
No description provided.