Skip to content

feat(Lungo-UI): Centralized error handling - #712

Merged
misi-bp merged 36 commits into
mainfrom
648/error-handling
Jul 27, 2026
Merged

feat(Lungo-UI): Centralized error handling#712
misi-bp merged 36 commits into
mainfrom
648/error-handling

Conversation

@misi-bp

@misi-bp misi-bp commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Overhaul Lungo frontend networking and failure handling: replace axios with a shared fetch stack, centralize URLs and request targets, report API errors consistently, and surface actionable messages across chat, streaming, agentic graph, and modals. Follow-up commits on this branch align reportRequestError labels with fetch targets, fix graph OASF/identity edge cases, and document the pipeline for maintainers.


Description

HTTP client and URL layer

  • Replace axios with httpFetch and helpers: fetchJson, fetchNdjsonStream, fetchSse (shared SSE frame parsing).
  • Introduce HttpError, parseHttpError, and endpointLabel on errors for logging and UI metadata.
  • Centralize routes in urls.ts (apiPaths, env-backed bases) and httpRequestTargets.ts / HttpRequestTarget builders; migrate agenticWorkflowsClient and catalog consumers to fetch.
  • workflowChatRouting resolves prompt/stream/suggested-prompt URLs from WorkflowSummary.chat_api_target and streaming flags.

Error reporting and global UI

  • reportRequestError: structured dev/prod logging; optional userMessage → global notification banner via errorNotificationStore.
  • reportUiError, ErrorBoundary with recoverable fallback, and error notification banner on RootPage.
  • Logs and banner source prefer HttpError.endpointLabel when the transport layer set it.

Chat and streaming

  • Agent prompt (JSON and NDJSON), auction / group / recruiter streaming stores unified on fetchNdjsonStream + reportRequestError; shared ndjsonStreamingStatus / stream teardown hardening.
  • Pattern reference documentation and pattern chat use agentic-workflows request builders; errors reported at hook boundaries (no duplicate logging in stream UI callbacks).
  • Suggested prompts, transport config, and catalog/bootstrap/SSE failures surfaced with user-visible messages instead of silent failures.
  • useApp split into focused hooks (useAppPromptHandlers, streaming effects, workflow catalog, pattern reference, etc.).

Graph, modals, and identity

  • Unified modal error presentation (LoadingErrorState, compact negative empty states) for badge, policy, OASF, and about flows.
  • reportRequestError in graph modals uses the same endpointLabel as the fetch (badgeDetailsRequest, oasfRecordRequest, pattern chat/documentation builders).
  • useNodeTransportInterfaces: pass workflow chat_api_target into fetchOasfRecord (fixes logistics OASF 404s to exchange port); cache empty transport results to avoid refetch loops.
  • Directory node: dedicated OASF modal content (directory URL/version); no identity-apps badge/policy actions; safe endpoint labels in identity modal catch when slug resolution fails.
  • Directory information modal field typography aligned with Info modal (body2 label/value rows).

UI polish and dependencies

  • Conditional TransportRail padding on CustomNode only; dark-mode resting rail label contrast; compact-group layout padding split.
  • Content-Type: application/json on JSON POST bodies (fixes 422 on /agent/prompt after axios removal).
  • Bump @open-ui-kit/core to 2.2.3; prefer OUK imports over direct MUI where touched; security-related dependency updates and tsconfig adjustments.

Documentation

  • Add http-and-error-handling.md — URL builders, transport helpers, reportRequestError contract, and per-feature error presentation map.

Tests

  • Coverage for parseHttpError, reportRequestError, ErrorBoundary, workflow chat routing, agentic workflows API parsing, topology/identity UI map, and related regressions.

Issue link

Fixes #648

Type of change

  • Bugfix
  • New feature
  • Breaking change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented (http-and-error-handling.md)
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@misi-bp
misi-bp requested a review from a team as a code owner July 22, 2026 11:00

@delthazor delthazor left a comment

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.

The solution is comprehensive, and very solid. I think it is good overall, I just had small nitpicks.

Comment thread coffeeAGNTCY/coffee_agents/lungo/frontend/src/errors/ui/errorNotificationStore.ts Outdated
pregnor
pregnor previously approved these changes Jul 22, 2026

@pregnor pregnor left a comment

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.

LGTM at a glance, looked good on the live show

@misi-bp

misi-bp commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author
image image image image

pregnor
pregnor previously approved these changes Jul 23, 2026

@pregnor pregnor left a comment

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.

LGTM still, just fix the CI issues

misi-bp added 10 commits July 23, 2026 16:56
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
pregnor
pregnor previously approved these changes Jul 24, 2026
misi-bp added 11 commits July 24, 2026 10:33
Signed-off-by: misi-bp <mkaloczy@cisco.com>
…Error

Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
…tores

Signed-off-by: misi-bp <mkaloczy@cisco.com>
…ll HTTP calls use the fetch-based client.

Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
misi-bp added 15 commits July 24, 2026 12:22
Signed-off-by: misi-bp <mkaloczy@cisco.com>
…nt types

Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
…after the axios-fetchJson refactor

Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
…ormatting

Signed-off-by: misi-bp <mkaloczy@cisco.com>
…d pattern chat

Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
Signed-off-by: misi-bp <mkaloczy@cisco.com>
… slug throw in modal catch

Signed-off-by: misi-bp <mkaloczy@cisco.com>
…al body2 style

Signed-off-by: misi-bp <mkaloczy@cisco.com>

@delthazor delthazor left a comment

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.

Pretty robust, let's see it in action

@misi-bp
misi-bp merged commit f5a0582 into main Jul 27, 2026
20 checks passed
@misi-bp
misi-bp deleted the 648/error-handling branch July 27, 2026 11:15
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.

[UI]: Implement proper UI error handling

3 participants