Skip to content

[BUG] V1 conversational agent with native function calling leaves unresolved tool_descriptions/tool_names in prompt parameter - #4931

Merged
akolarkunnu merged 5 commits into
opensearch-project:mainfrom
akolarkunnu:chat_bot
Jul 29, 2026
Merged

[BUG] V1 conversational agent with native function calling leaves unresolved tool_descriptions/tool_names in prompt parameter#4931
akolarkunnu merged 5 commits into
opensearch-project:mainfrom
akolarkunnu:chat_bot

Conversation

@akolarkunnu

Copy link
Copy Markdown
Collaborator

Description

Conversational agents using native function calling (tool_template / _tools) no longer leave tool_descriptions and tool_names unset in the LLM predict parameter map. Those keys are initialized to empty strings when not provided explicitly, so connector payload substitution and validation succeed instead of failing with unfilled placeholders.

Fixes agent execution errors such as:

Invalid Request: Some parameter placeholder not filled in payload: tool_descriptions, tool_names

This shows up when building chatbot / Assistant setups (e.g. Bedrock Converse + function calling) where tools are sent via the API rather than the legacy ReAct prompt, but the connector request body still references ${parameters.tool_descriptions} and ${parameters.tool_names}

What changed
In AgentUtils.addToolsToFunctionCalling(), after building _tools, set:

tool_descriptions → "" if missing
tool_names → "" if missing
Explicit values in agent or connector parameters are unchanged (getOrDefault).

Related Issues

Resolves #4916

Check List

  • New functionality includes testing.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…esolved tool_descriptions/tool_names in prompt parameter

Resolves opensearch-project#4916

Signed-off-by: Abdul Muneer Kolarkunnu <muneer.kolarkunnu@netapp.com>
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 6114acd)

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

Resolves opensearch-project#4916

Signed-off-by: Abdul Muneer Kolarkunnu <muneer.kolarkunnu@netapp.com>
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit e6172f0

@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 24, 2026 11:52 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 24, 2026 11:52 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 24, 2026 11:52 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 24, 2026 11:52 — with GitHub Actions Failure
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 6c369e6

@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 24, 2026 15:34 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 24, 2026 15:34 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 24, 2026 15:34 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 24, 2026 15:34 — with GitHub Actions Failure
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit ef9f9e0

@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 25, 2026 03:07 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 25, 2026 03:07 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 25, 2026 03:07 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 25, 2026 03:07 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 6114acd

@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 29, 2026 00:36 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 29, 2026 00:36 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 29, 2026 00:36 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 29, 2026 00:36 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 29, 2026 05:54 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu had a problem deploying to ml-commons-cicd-env July 29, 2026 05:54 — with GitHub Actions Failure
@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 29, 2026 06:30 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 29, 2026 06:53 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu temporarily deployed to ml-commons-cicd-env July 29, 2026 06:53 — with GitHub Actions Inactive
@akolarkunnu
akolarkunnu merged commit b78e33d into opensearch-project:main Jul 29, 2026
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] V1 conversational agent with native function calling leaves unresolved tool_descriptions/tool_names in prompt parameter

2 participants