Skip to content

fix: always send tool config fields regardless of enable_as_tool state#213

Merged
amirasaran merged 1 commit intodevelopmentfrom
feature/agentic
Feb 25, 2026
Merged

fix: always send tool config fields regardless of enable_as_tool state#213
amirasaran merged 1 commit intodevelopmentfrom
feature/agentic

Conversation

@amirasaran
Copy link
Contributor

@amirasaran amirasaran commented Feb 25, 2026

User description

  • Remove conditional clearing of tool_function_name and tool_description when enable_as_tool is false
  • Backend now handles empty string values appropriately when tool is disabled

PR Type

Bug fix


Description

  • Remove conditional clearing of tool config fields in API requests

  • Always send tool_function_name and tool_description values

  • Backend now handles empty strings when tool is disabled


Diagram Walkthrough

flowchart LR
  A["Tool Config State"] -->|Previously| B["Clear fields if disabled"]
  A -->|Now| C["Always send values"]
  B --> D["Backend receives empty strings"]
  C --> D
  D --> E["Backend handles appropriately"]
Loading

File Walkthrough

Relevant files
Bug fix
useAgentToolConfig.ts
Remove conditional field clearing in tool config save       

frontend/src/hooks/useAgentToolConfig.ts

  • Removed ternary conditional that cleared tool_function_name and
    tool_description when enableAsTool is false
  • Now always sends the actual field values to the API regardless of tool
    enabled state
  • Delegates empty string handling to backend logic
+2/-2     

- Remove conditional clearing of tool_function_name and tool_description when enable_as_tool is false
- Backend now handles empty string values appropriately when tool is disabled
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 25, 2026
@amirasaran amirasaran merged commit 852c350 into development Feb 25, 2026
2 of 3 checks passed
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Missing null handling: The request now always sends tool_function_name and tool_description without guarding
against null/undefined or enforcing empty-string defaults, which could cause unexpected
backend validation/serialization edge cases.

Referred Code
tool_function_name: toolFunctionName,
tool_description: toolDescription

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Client-side validation gap: Always sending tool_function_name and tool_description increases reliance on server-side
validation/sanitization, and it is not verifiable from this diff that these values are
validated/sanitized before being sent.

Referred Code
tool_function_name: toolFunctionName,
tool_description: toolDescription

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Trim whitespace before sending

Trim whitespace from toolFunctionName and toolDescription before sending them in
the API payload to ensure clean data.

frontend/src/hooks/useAgentToolConfig.ts [44-45]

-tool_function_name: toolFunctionName,
-tool_description: toolDescription
+tool_function_name: toolFunctionName.trim(),
+tool_description: toolDescription.trim()
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: This is a good practice for data sanitization that improves data quality by removing extraneous whitespace from user input before it's sent to the API.

Low
  • More

@dosubot dosubot bot added the 🎨 bug:frontend UI bugs, display issues label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 bug:frontend UI bugs, display issues Review effort 1/5 size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant