Skip to content

fix(client): surface desktop AI stream request failures - #2821

Open
HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/desktop-ai-chat-error-callback
Open

HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/desktop-ai-chat-error-callback

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

N/A - no matching issue was found.

Summary

Desktop AI SSE startup failures were rejected by the controller bridge without being delivered to the request-specific stream listener, leaving the consumer waiting indefinitely. Synchronous bridge callbacks could also fire before listener registration, while ordinary acknowledgement payloads could be mistaken for failures. This change normalizes controller/native failures into stream error events, defers synchronous dispatch until listener registration, settles missing or throwing bridges, and preserves normal acknowledgements.

The final manifest amendment keeps the expanded test:sse-request command but removes its redundant insertion into the shared prebuild chain. Community CI already invokes that named test directly, and the amendment avoids a merge conflict with the database-selector PR.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • yarn test:sse-request: passed ownership, transport, and production adapter contracts.
    • Targeted ESLint for the desktop SSE adapter, failure helper, and tests: passed.
    • Full Community Umi/Webpack build, including the complete prebuild contract set: succeeded.
    • Production bundle verifier passed both as postbuild and standalone.
    • git diff --check origin/main...HEAD: passed.
    • Merge-tree with selector head 2828cf80e: zero conflict markers; both selector and SSE test scripts are retained.
    • Temporary fork verification PR 优化: 配置支持自定义 #85 at head 7aa7ea315a32fefe2b8a6039abf5cb108ffe67a9: Frontend, Backend, JavaScript CodeQL, and Java CodeQL all passed.
  • Manual verification: N/A - deterministic event-bus tests cover controller envelopes, native rejection, synchronous callbacks, missing/throwing bridges, acknowledgements, and listener ordering.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: No public API or persisted-state changes.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: No new data flow; existing failure messages are routed to the owning stream request.
  • Community / Local / Pro boundary: Shared Community desktop SSE adapter.
  • Backward compatibility: Successful stream setup and normal acknowledgements keep their existing behavior; previously silent terminal failures now reject through the stream error path.

Reviewer map

  • Start here: service/sse/requestFailure.ts, then service/sse/index.tsx and the adapter tests.
  • Failure condition: a controller/native setup failure leaves the stream pending, a synchronous callback is lost before listener registration, a normal acknowledgement is emitted as an error, or the manifest conflicts with selector head 2828cf80e.
  • Rollback or disable path: Revert commit 7aa7ea315a32fefe2b8a6039abf5cb108ffe67a9; no migration is required.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: OpenAI Codex assisted with diagnosis, implementation, automated tests, verification, conflict analysis, and adversarial review.

Latest-main revalidation (2026-09-04)

  • Rebased onto upstream 144a04e; current head 7aa7ea3.
  • SSE ownership, transport, and desktop request-failure tests passed; targeted ESLint passed.
  • Included in the green combined Community production build and bundle verification.

@HandSonic
HandSonic requested review from a team and openai0229 as code owners August 30, 2026 13:00
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 30, 2026
@HandSonic
HandSonic force-pushed the fix/desktop-ai-chat-error-callback branch 2 times, most recently from 3941455 to b2bf399 Compare September 3, 2026 08:35
@HandSonic
HandSonic force-pushed the fix/desktop-ai-chat-error-callback branch from b2bf399 to 7aa7ea3 Compare September 3, 2026 21:08
Align existing OtterMind/Chat2DB PR OtterMind#2821, retaining its focused behavior and current Community contracts.

This branch has not been deployed

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants