* feat(ai): support editing sent user messages
Adds inline edit support for user messages in the AI chat panel.
Hover over a user message to reveal the edit button; confirming the
edit truncates all subsequent history and re-sends with the new content.
* fix(ai): fix IME composition and ref-focus regression in message edit
- Handle IME composition events in onEditKeydown to prevent accidental
submission on Enter during CJK candidate selection
- Replace per-render :ref focus callback with nextTick + data attribute
to avoid cursor jumping on every keystroke
- Extract visibleToActualIndex into aiMessageEdit.ts for testability
- Add 8 unit tests covering index mapping with contextSummary messages
* fix(ai): prevent data loss and mention pollution in message edit
- Guard connection/config before truncating messages to prevent silent data
loss when send() bails early
- Clear selectedMentions before resend to prevent stale chips from polluting
edited message content
* fix(ai): limit indexes and foreign keys per table in schema context
Prevent AI input token spikes caused by tables with large numbers of
indexes or foreign keys being fully serialized into the system prompt.
Apply a default cap of 10 indexes and 10 FKs per table in all three
schema-loading paths: focused_table mode, database mode, and
loadMentionedTableContext for @-mentioned tables.
Both limits are configurable via buildAiContext options
(maxIndexesPerTable, maxFksPerTable).
* fix(ai): truncate large column values in result preview
Prevent input token explosion when the active tab contains large text
or JSON fields (e.g. request_body, response_body in audit log tables).
formatResultPreview previously serialized each value without any length
limit, so 5 rows from a wide table with multi-KB text columns could
produce 100K+ tokens in the system prompt.
Cap each serialized value at 200 characters with an ellipsis suffix.
* fix(app): unify import and export icons across sidebar surfaces
Use Upload for import actions and Download for export actions in the
connection sidebar, object browser, connection tree menus, and table
toolbox so icon semantics match the rest of the app.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(i18n): rename import result archive tooltip label
Clarify the editor toolbar action as importing a saved result archive so
it pairs clearly with the save result archive action.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ai): merge tool call status cards
* fix(ai): constrain markdown table overflow
* fix(ai): restore streaming of answer text via TextDelta events
The on_chunk closure was missing live AgentEvent::TextDelta emission for text content, causing the AI answer text to appear all at once after the turn completed. Reasoning deltas were unaffected.
Root cause: commit c30033628 rewrote the on_chunk closure and accidentally dropped the TextDelta emit line while keeping ReasoningDelta intact.
Fix: restore TextDelta emit in on_chunk for incremental streaming, and remove the post-turn full-TextDelta workaround which would duplicate content.
* test(ai): extract chunk_to_events and add streaming event tests
Extract the event-generation logic from the on_chunk closure into a pure function chunk_to_events() to make it testable, and add 6 unit tests covering all chunk content combinations: text-only, reasoning-only, mixed, empty, and edge cases.
This ensures a regression like the one fixed in the previous commit (where TextDelta emission was dropped while ReasoningDelta was kept) would be caught by tests.