Skip to content

[8.18] [Obs AI Assistant]fixing error - Display results and Visualize query Bedrock Error (#218213)#227656

Merged
arturoliduena merged 2 commits intoelastic:8.18from
arturoliduena:backport/8.18/pr-218213
Jul 11, 2025
Merged

[8.18] [Obs AI Assistant]fixing error - Display results and Visualize query Bedrock Error (#218213)#227656
arturoliduena merged 2 commits intoelastic:8.18from
arturoliduena:backport/8.18/pr-218213

Conversation

@arturoliduena
Copy link
Contributor

Backport

This will backport the following commits from main to 8.18:

Questions ?

Please refer to the Backport tool documentation

…Bedrock Error (elastic#218213)

### Fix: Bedrock Streaming Error on ES|QL Actions

#### Summary

When an ES|QL is generated, we present two action buttons:
- Visualize Query
- Display Results

These actions were not working as expected when using Bedrock as the
model provider.

#### Error Details
```txt
Encountered error in Bedrock stream of type validationException messages.8: Did not find 1 `tool_result` block(s) at the beginning of this message. Messages following `tool_use` blocks must begin with a matching number of `tool_result` blocks.
```
#### Root Cause

We were sending a tool_use block in the assistant message without
immediately following it with the corresponding tool_result block. This
violates Bedrock’s message protocol.

(cherry picked from commit 33993b7)

# Conflicts:
#	x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_body.tsx
@arturoliduena arturoliduena added the backport This PR is a backport of another PR label Jul 11, 2025
@arturoliduena arturoliduena enabled auto-merge (squash) July 11, 2025 13:16
@botelastic botelastic bot added the Team:Obs AI Assistant Observability AI Assistant label Jul 11, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@viduni94
Copy link
Contributor

/ci

@arturoliduena arturoliduena merged commit 39b0f08 into elastic:8.18 Jul 11, 2025
8 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observabilityAIAssistantApp 266.6KB 266.7KB +27.0B
searchAssistant 163.3KB 163.4KB +27.0B
total +54.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observabilityAIAssistant 41.5KB 41.5KB -41.0B

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Obs AI Assistant Observability AI Assistant

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants