Skip to content

Conversation

@Hailong-am
Copy link
Contributor

Description

Pass tenant id from agent to tools

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

Signed-off-by: Hailong Cui <[email protected]>
@Hailong-am Hailong-am requested a deployment to ml-commons-cicd-env-require-approval November 21, 2025 00:27 — with GitHub Actions Waiting
@Hailong-am Hailong-am requested a deployment to ml-commons-cicd-env-require-approval November 21, 2025 00:27 — with GitHub Actions Waiting
@Hailong-am Hailong-am requested a deployment to ml-commons-cicd-env-require-approval November 21, 2025 00:27 — with GitHub Actions Waiting
@Hailong-am Hailong-am requested a deployment to ml-commons-cicd-env-require-approval November 21, 2025 00:27 — with GitHub Actions Waiting
@ylwu-amzn ylwu-amzn merged commit 9b9f71d into opensearch-project:feature/3.4-release-prep Nov 21, 2025
5 of 9 checks passed
@Hailong-am Hailong-am mentioned this pull request Nov 25, 2025
5 tasks
@jiapingzeng
Copy link
Contributor

@Hailong-am this change breaks agent execution when no tenant ID is specified in the request:

[2025-11-25T16:03:21,027][ERROR][o.o.m.e.a.a.MLChatAgentRunner] [integTest-0] Failed to run chat agent
java.lang.NullPointerException: null
        at java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011) ~[?:?]
        at java.base/java.util.concurrent.ConcurrentHashMap.putAll(ConcurrentHashMap.java:1089) ~[?:?]
        at org.opensearch.ml.engine.algorithms.agent.MLChatAgentRunner.lambda$runReAct$3(MLChatAgentRunner.java:505) ~[?:?]
        at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) ~[opensearch-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
        at org.opensearch.common.util.concurrent.ListenableFuture$1.doRun(ListenableFuture.java:126) ~[opensearch-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
        at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52) ~[opensearch-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
        at org.opensearch.common.util.concurrent.OpenSearchExecutors$DirectExecutorService.execute(OpenSearchExecutors.java:341) ~[opensearch-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
        at org.opensearch.common.util.concurrent.ListenableFuture.notifyListener(ListenableFuture.java:120) ~[opensearch-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
        at org.opensearch.common.util.concurrent.ListenableFuture.lambda$done$0(ListenableFuture.java:112) ~[opensearch-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) ~[?:?]

Can we do

                            if (tenantId != null) {
                                toolParams.put(TENANT_ID_FIELD, tenantId);
                            }

@jiapingzeng
Copy link
Contributor

Oh, I see that this will be fixed in #4463

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.

3 participants