Skip to content

feat(agentStudio): surface service errors deep thread#6983

Draft
pipeline1987 wants to merge 1 commit into
masterfrom
feat/agent-studio-surface-conversation-errors
Draft

feat(agentStudio): surface service errors deep thread#6983
pipeline1987 wants to merge 1 commit into
masterfrom
feat/agent-studio-surface-conversation-errors

Conversation

@pipeline1987
Copy link
Copy Markdown

@pipeline1987 pipeline1987 commented Apr 21, 2026

Summary

Surfaces conversation and transport errors end-to-end in the InstantSearch chat stack (ai-lite → connector → widgets → UI), so failures from the assistant thread are visible in the chat UI instead of failing silently or only in logs.

How

  • ai-lite (abstract-chat, transport, stream parser, utils)

    • Stronger error handling for requests and streaming (including normalized error text where relevant).
    • Ensures error objects are cloned when updating state so React/connectors don’t skip re-renders when only the error message or reference semantics would look “unchanged”.
  • connectChat + chat widget

    • Wires error-related state through the connector render state so vanilla and React consumers get the same behavior.
  • UI (instantsearch-ui-components)

    • Chat surfaces errors in the message list and header where appropriate (Chat, ChatMessages, ChatMessageError, ChatHeader, layouts, icons).
    • Shared chat utilities and types updated to support error display and behavior.
  • Styling (instantsearch.css)

    • Styles for the error message/header treatment (including theme/reset hooks as needed).
  • React (react-instantsearch)

    • useConnector + dequal adjustments so connector updates (including errors) propagate reliably to components.
  • Tests

    • Coverage across ai-lite, connector, UI utils, and chat components; common widget tests updated where translations/options changed.
  • Example

    • Small tweak in examples/react/e-commerce/App.tsx aligned with the new behavior.

Result

  • thread depth
image
  • max iterations
image
  • max tokens
image

@pipeline1987 pipeline1987 self-assigned this Apr 21, 2026
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 21, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 107 complexity · 52 duplication

Metric Results
Complexity 107
Duplication 52

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@pipeline1987 pipeline1987 force-pushed the feat/agent-studio-surface-conversation-errors branch from 0e6aedb to 307b374 Compare April 21, 2026 20:21
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 21, 2026

More templates

algoliasearch-helper

npm i https://pkg.pr.new/algolia/instantsearch/algoliasearch-helper@6983

instantsearch-ui-components

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch-ui-components@6983

instantsearch.css

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch.css@6983

instantsearch.js

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch.js@6983

react-instantsearch

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch@6983

react-instantsearch-core

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-core@6983

react-instantsearch-nextjs

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-nextjs@6983

react-instantsearch-router-nextjs

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-router-nextjs@6983

vue-instantsearch

npm i https://pkg.pr.new/algolia/instantsearch/vue-instantsearch@6983

commit: 59f37b8

@pipeline1987 pipeline1987 force-pushed the feat/agent-studio-surface-conversation-errors branch from 307b374 to 322a039 Compare April 21, 2026 21:07
feat(agentStudio): surface conversation errors

feat(agentStudio): cost controls error handler
@pipeline1987 pipeline1987 force-pushed the feat/agent-studio-surface-conversation-errors branch from 322a039 to 59f37b8 Compare April 21, 2026 21:18
Copy link
Copy Markdown
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you split this up please?

'id' in renderState
? (renderState as { id?: unknown }).id
: undefined;
// Chat (and similar) expose `id`; when it changes (e.g. new conversation),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there some way to implement this without the deep changes in useConnector? as I believe there's no other widgets with id, normally if widgets change attributes (similar to id?) they just get deleted and re-added

@pipeline1987
Copy link
Copy Markdown
Author

could you split this up please?

fs, I've split this in two pieces

#6991
#6992

@Haroenv Haroenv requested review from a team, FabienMotte and afrencalg and removed request for a team April 24, 2026 15:20
@pipeline1987 pipeline1987 marked this pull request as draft April 24, 2026 16:05
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.

2 participants