[PR #2023] [MERGED] Show boolean-enabled custom tools in selectors #5395

Closed
opened 2026-10-22 04:15:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2023
Author: @Xelvanis
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/custom-tool-enabled-selector


📝 Commits (2)

  • ceccbbf catalog: show boolean-enabled custom tools
  • dadb829 catalog: reject invalid numeric custom tool flags

📊 Changes

1 file changed (+13 additions, -3 deletions)

View changed files

📝 src/features/catalog/agents/hooks/use-custom-tools.ts (+13 -3)

📄 Description

Linked issue

Closes #2015

Why this change

New refactor custom tools are saved with enabled: true as a boolean, but the selector helper only treated legacy string values as enabled. That made valid static and webhook tools disappear from Chat Settings and Agent tool pickers immediately after creation.

What changed

  • Updated the custom-tool selector row shape to accept non-string enabled values.
  • Added selector-side enabled normalization for boolean values plus legacy "true" / "1" strings.
  • Preserved disabled handling for boolean false, "false", and "0".
  • Kept existing static/webhook selectability requirements: static tools need a result and webhook tools need a URL.

Refactor impact

Primary owner:

Catalog agents custom-tool hooks.

Impact areas reviewed:

  • Agent editor tool picker.
  • Chat Settings custom-tool picker.
  • Tool editor save payload for newly created custom tools.
  • Runtime/Rust custom-tool enabled parsing for storage and execution parity.
  • Legacy Marinara behavior: legacy persisted string enabled values, while refactor can persist booleans through generic storage.

Boundary notes:

  • Feature/catalog hook only.
  • No engine generation, shared API wrapper, Rust command, storage contract, or remote runtime boundary changed.

Pressure points touched:

None.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Focused Vite SSR selector probe: boolean true, "true", and "1" are selectable when static/webhook requirements are met; boolean false, "false", "0", and missing webhook URL are not selectable.
  • pnpm typecheck passed.
  • pnpm check passed.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

Bugfix for existing custom-tool selector behavior; no new discoverable feature.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs changes needed for this focused selector fix.

UI evidence

No screenshot captured. This was proved with selector-level module output, not a native UI walkthrough.

Summary by CodeRabbit

  • Bug Fixes
    • Improved custom tool enabled/disabled state handling to correctly interpret and normalize multiple data formats including booleans, numbers, and string variations ("true"/"false", "1"/"0") for better compatibility and consistent tool selectability.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2023 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/custom-tool-enabled-selector` --- ### 📝 Commits (2) - [`ceccbbf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ceccbbfd43003531b805465cadd7c04d3c0724a9) catalog: show boolean-enabled custom tools - [`dadb829`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dadb829ab920abe5c063a16d670cd4152597ff06) catalog: reject invalid numeric custom tool flags ### 📊 Changes **1 file changed** (+13 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/features/catalog/agents/hooks/use-custom-tools.ts` (+13 -3) </details> ### 📄 Description ## Linked issue Closes #2015 ## Why this change New refactor custom tools are saved with `enabled: true` as a boolean, but the selector helper only treated legacy string values as enabled. That made valid static and webhook tools disappear from Chat Settings and Agent tool pickers immediately after creation. ## What changed - Updated the custom-tool selector row shape to accept non-string `enabled` values. - Added selector-side enabled normalization for boolean values plus legacy `"true"` / `"1"` strings. - Preserved disabled handling for boolean `false`, `"false"`, and `"0"`. - Kept existing static/webhook selectability requirements: static tools need a result and webhook tools need a URL. ## Refactor impact Primary owner: Catalog agents custom-tool hooks. Impact areas reviewed: - Agent editor tool picker. - Chat Settings custom-tool picker. - Tool editor save payload for newly created custom tools. - Runtime/Rust custom-tool enabled parsing for storage and execution parity. - Legacy Marinara behavior: legacy persisted string enabled values, while refactor can persist booleans through generic storage. Boundary notes: - Feature/catalog hook only. - No engine generation, shared API wrapper, Rust command, storage contract, or remote runtime boundary changed. Pressure points touched: None. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Focused Vite SSR selector probe: boolean `true`, `"true"`, and `"1"` are selectable when static/webhook requirements are met; boolean `false`, `"false"`, `"0"`, and missing webhook URL are not selectable. - `pnpm typecheck` passed. - `pnpm check` passed. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: Bugfix for existing custom-tool selector behavior; no new discoverable feature. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No docs changes needed for this focused selector fix. ## UI evidence No screenshot captured. This was proved with selector-level module output, not a native UI walkthrough. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved custom tool enabled/disabled state handling to correctly interpret and normalize multiple data formats including booleans, numbers, and string variations ("true"/"false", "1"/"0") for better compatibility and consistent tool selectability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:55 +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#5395
No description provided.