Skip to content

fix(ai): restore table mention suggestions - #2888

Merged
openai0229 merged 2 commits into
mainfrom
fix/isolate-ai-context-references
Sep 10, 2026
Merged

openai0229 merged 2 commits into
mainfrom
fix/isolate-ai-context-references

Conversation

@openai0229

@openai0229 openai0229 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

N/A - fixes the Community AI mention regression.

Summary

Community AI @ suggestions now contain only database tables and views. The popup opens on explicit @ input, supports keyboard and mouse selection, protects against stale table/view responses, keeps the type column fixed on the right, and ellipsizes long names with a native title. AI datasource selection exposes only groups, data sources, databases, and schemas; monitor, user, and account nodes are excluded.

Affected surfaces

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

Verification

  • yarn lint:eslint passed
  • yarn test:retired-ai passed
  • yarn build:web:community --app_version=0.0.0 passed, including production bundle verification
  • Maven clean package for all 48 Community modules passed
  • Focused backend tests passed
  • Playwright CLI against http://127.0.0.1:8899 with backend http://127.0.0.1:10835 verified @, keyboard Enter, mouse selection, Escape/delete close, datasource filtering, fixed type column, title tooltip, and table/view requests only
  • Source scan found no Community knowledge or context-reference markers

Risk and compatibility

  • Community chat requests and history no longer expose knowledge-selection or context-reference fields.
  • Existing unknown history fields remain ignored during deserialization.
  • Table/view mentions and attachments remain available.

Reviewer map

  • Start here: chat2db-community-client/src/blocks/AI/components/AIChatInput/index.tsx and chat2db-community-server/chat2db-community-web/src/main/java/ai/chat2db/community/web/api/adapter/ai/AiChatStreamAdapter.java
  • Failure condition: @ suggestions do not open, select stale results, or expose non-table nodes.

Contributor declaration

  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.

AI assistance: Codex traced the regression, removed the Community knowledge/context surface, added focused tests, and performed build and interaction verification.

@openai0229
openai0229 requested review from a team and auenger as code owners September 8, 2026 15:16
@openai0229 openai0229 moved this to In Review in Chat2DB Community Sep 8, 2026
@openai0229
openai0229 force-pushed the fix/isolate-ai-context-references branch 4 times, most recently from 9333224 to 6d6dd59 Compare September 9, 2026 06:01
@openai0229

Copy link
Copy Markdown
Contributor Author

Final code review completed on head 6d6dd590a84437ee0a130685bbc17337b2716216 after rebasing onto current main.

Review fixes included:

  • ignore stale in-flight table/view responses after the mention query changes;
  • make stored AI messages tolerate retired extension fields;
  • restrict the AI datasource selector to groups, datasources, databases, and schemas, excluding monitor/account/object nodes without mutating the shared workspace tree;
  • keep the table/view type in a fixed 36px trailing column and ellipsize long names while preserving the full native title.

Verification passed locally: yarn lint:eslint, yarn test:retired-ai, yarn build:web:community --app_version=0.0.0, and 14 focused Maven tests. Playwright against isolated real backend/frontend (10835/8899) covered bare and filtered mentions, keyboard/mouse selection, Escape/delete close, rapid query changes, datasource context filtering, fixed type-column geometry, long-name overflow, and network inspection with no knowledge endpoint calls.

No unresolved code-review findings remain.

@openai0229
openai0229 force-pushed the fix/isolate-ai-context-references branch from 6d6dd59 to fc57852 Compare September 9, 2026 08:07
@openai0229 openai0229 changed the title fix(ai): isolate context reference extensions fix(ai): restore table mention suggestions Sep 9, 2026
@openai0229
openai0229 force-pushed the fix/isolate-ai-context-references branch from fc57852 to b34e0a0 Compare September 10, 2026 01:06
@openai0229
openai0229 merged commit c56d8c6 into main Sep 10, 2026
14 of 16 checks passed
@openai0229
openai0229 deleted the fix/isolate-ai-context-references branch September 10, 2026 01:56
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant