Commit Graph

1682 Commits (dependabot/npm_and_yarn/runtime/electron-41.0.3)

Author SHA1 Message Date
Dave Page 6296016b67
Fix an issue where LLM responses are not streamed or rendered properly in the AI Assistant. #9734
* Address CodeRabbit review feedback for streaming and SQL extraction.

- Anthropic: preserve separators between text blocks in streaming to
  match _parse_response() behavior.
- Docker: validate that the API URL points to a loopback address to
  constrain the request surface.
- Docker/OpenAI: raise LLMClientError on empty streams instead of
  yielding blank LLMResponse objects, matching non-streaming behavior.
- SQL extraction: strip trailing semicolons before joining blocks to
  avoid double semicolons in output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address remaining CodeRabbit review feedback for streaming and rendering.

- Use distinct 3-tuple ('complete', text, messages) for completion events
  to avoid ambiguity with ('tool_use', [...]) 2-tuples in chat streaming.
- Pass conversation history from request into chat_with_database_stream()
  so follow-up NLQ turns retain context.
- Add re.IGNORECASE to SQL fence regex for case-insensitive matching.
- Render MarkdownContent as block element instead of span to avoid
  invalid DOM when response contains paragraphs, lists, or tables.
- Keep stop notice as a separate message instead of appending to partial
  markdown, preventing it from being swallowed by open code fences.
- Snapshot streamingIdRef before setMessages in error handler to avoid
  race condition where ref is cleared before React executes the updater.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address CodeRabbit review feedback for streaming providers and history.

- Fix critical NameError: use self._api_url instead of undefined API_URL
  in anthropic and openai streaming _process_stream() methods.
- Match sync path auth handling: conditionally set API key headers in
  streaming paths for both anthropic and openai providers.
- Remove unconditional temperature from openai streaming payload to
  match sync path compatibility approach.
- Add URL scheme validation to OllamaClient.__init__ to prevent unsafe
  local/resource access via non-http schemes.
- Guard ollama streaming finalizer: raise error when stream drops
  without a done frame and no content was received.
- Update chat.py type hint and docstring for 3-tuple completion event.
- Serialize and return filtered conversation history in the complete
  SSE event so the client can round-trip it on follow-up turns.
- Store and send conversation history from NLQChatPanel, clear on
  conversation reset.
- Fix JSON-fallback SQL render path: clear content when SQL was
  extracted without fenced blocks so ChatMessage uses sql-only renderer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix missing closing brace in NLQChatPanel switch statement.

Adding block scoping to the error case introduced an unmatched brace
that prevented the switch statement from closing properly, causing
an eslint parse error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix missing compaction module and SQL extraction test.

- Replace compaction module imports with inline history deserialization
  and filtering since compaction.py is on a different branch.
- Add rstrip(';') to SQL extraction test to match production code,
  fixing double-semicolon assertion failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix SQL extraction test expected values after rstrip(';') change.

The rstrip(';') applied to each block before joining means single
blocks and the last block in multi-block joins no longer have
trailing semicolons. Update expected values to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Strictly guard Ollama stream: raise if no terminal done frame received.

Truncated content from a dropped connection should not be treated as
a complete response, even if partial text was streamed. Always raise
when final_data is None, matching CodeRabbit's recommendation.
2026-03-17 11:41:57 +05:30
Dave Page 990b4f5e54
Fix an issue where the AI Assistant was not retaining conversation context between messages, with chat history compaction to manage token budgets.
* Address CodeRabbit review feedback for chat context and compaction.

- Track tool-use turns as groups instead of one-to-one pairs, so
  multi-tool assistant messages don't leave orphaned results.
- Add fallback to shrink the recent window when protected messages
  alone exceed the token budget, preventing compaction no-ops.
- Fix low-value test fixtures to keep transient messages short so
  they actually classify as low-importance.
- Guard Clear button against in-flight stream race conditions by
  adding a clearedRef flag and cancelling active streams.
- Assert that conversation history is actually passed through to
  chat_with_database in the "With History" test.

* Address remaining CodeRabbit review feedback for compaction module.

- Expand protected set to cover full tool groups, preventing orphaned
  tool call/result messages when a turn straddles the recent window.
- Add input validation in deserialize_history() for non-list/non-dict data.
- Strengthen test assertion for preserved recent window tail.


* Fix CI test failures in compaction and NLQ chat tests.

- Lower max_tokens budget in test_drops_low_value to reliably force
  compaction (500 was borderline, use 200).
- Consume SSE response data before asserting mock calls in NLQ chat
  test, since Flask's streaming generator only executes on iteration.


* Clarify mock patch target in NLQ chat test.

Add comment explaining why we patch the source module rather than the
use site: the endpoint uses a local import inside the function body,
so there is no module-level binding to patch.
2026-03-16 19:02:36 +05:30
Anil Sahoo 01c2d12b51
Fixed an issue where selecting all in the Query Tool's Messages tab would select the entire page content. #8992 2026-03-16 14:39:42 +05:30
Dave Page da55da4d32
Replace misleading AI thinking messages with fun elephant-themed ones. #9702
The previous messages like "Vacuuming the catalog..." and "Analyzing
table statistics..." could be mistaken for actual database operations.
Replace them with clearly whimsical elephant-themed messages, expand
the pool to 32 messages, and consolidate them into a single shared
module with gettext() support.
2026-03-16 14:23:05 +05:30
Dave Page 23bd3359c1
Fixed an issue where AI features are visible in the UI even when LLM_ENABLED is set to False. 2026-03-16 12:35:16 +05:30
Dave Page 0bc4edbab5
Improve the AI Assistant user prompt to be more descriptive of the actual functionality. 2026-03-16 12:34:44 +05:30
Dave Page 34aa360830
Allow copying of text from the AI Assistant chat panel. #9738 2026-03-16 12:16:45 +05:30
Dave Page 78e3b67eb1
Fix an issue where the AI Assistant input textbox sometimes swallows the first character of input. #9740 2026-03-16 12:06:47 +05:30
Pravesh Sharma f49c967bfd
Added support to download binary data from result grid. #4011 2026-03-10 12:25:21 +05:30
Anil Sahoo 395ff36322
Ensure that the Geometry Viewer refreshes when re-running queries or switching geometry columns, preventing stale data from being displayed. #9392 2026-03-09 16:08:14 +05:30
Rohit Bhati caafc6bb1b
Fix broken checkbox selection in backup dialog objects tree. #9649 2026-02-27 17:01:11 +05:30
Lance J. 6d0d387f53
ERD Tool: Insert table with relations via drag-and-drop. #5578 #8198
* Add preference for insert with relations

Co-authored-by: Christian P. <pirnichristian@gmail.com>

* Insert tables with relations on drag and drop

Co-authored-by: Christian P. <pirnichristian@gmail.com>

* Fix test mock not returning Erd Supported Data

Co-authored-by: Christian P. <pirnichristian@gmail.com>

---------

Co-authored-by: Christian P. <pirnichristian@gmail.com>
2026-02-24 12:15:54 +05:30
Khushboo Vashi 5002419611
Fixed an issue where the 'Quote strings only' configuration was ignored when downloading the result set. #7578 2026-02-17 17:19:41 +05:30
Dave Page f2756a3dcf
Core LLM integration infrastructure to allow pgAdmin to connect to AI providers. #9641
* Core infrastructure for LLM integration.
* Add support for a number of different AI generated reports on security, performance, and schema design on servers, databases, and schemas, as appropriate.
* Add a Natural Language AI assistant to the Query Tool.
* Add an AI Insights panel to the EXPLAIN tool in the Query Tool, to analyse and report on issues in query plans.
2026-02-17 17:16:06 +05:30
Pravesh Sharma 9039080214 Fixed an issue where a long name in ERD table node was not breaking into multiple lines. 2026-02-09 14:53:51 +05:30
Pravesh Sharma 5abd9e3c5b
Fixed an issue where tools settings changed by the users were not restored on application relaunch. #8988 2026-02-09 10:54:53 +05:30
Rohit Bhati 0cb6738343
Fix pgAdmin fails when performing Backup/Restore on a PostgreSQL connection defined exclusively via pg_service.conf. #9553 2026-01-30 16:54:48 +05:30
Aditya Toshniwal 7c36eaba90
Warn user of unsaved data output edits before page navigation. #8916 2026-01-14 18:20:52 +05:30
Akshay Joshi 62e2d18b02
Mask the secret key for restrict option in the process watcher when restoring plain SQL file. #9518
Fixed coderabbit review comment.
2026-01-08 11:39:01 +05:30
Rohit Bhati 965a6ad886
Fix Query Tool state restoration for new connections and queries. #8987 2026-01-05 16:32:49 +05:30
Akshay Joshi 52daa56a04 Copyright updated for 2026 2026-01-05 13:33:45 +05:30
Aditya Toshniwal 491fbe8a36
Add a new button in the query tool data output toolbar to get entire range of data. #8890 2025-12-12 15:38:01 +05:30
Aditya Toshniwal 63397a003a Fixed an issue where the Query History panel would auto-scroll to the top and did not preserve the scroll bar position for the selected entry. #9380 2025-12-12 11:27:39 +05:30
Anil Sahoo 55a332be5b
Fix an issue with the type casting of default string function/procedure arguments in the debugger tool. #9036 2025-12-08 14:24:00 +05:30
Akshay Joshi d5a909f14c
Plain SQL restore runs with '\restrict' option to prevent harmful psql meta-commands. #9368 2025-12-08 11:02:10 +05:30
Aditya Toshniwal dd51290d06 Upgrade React version to latest as upstream has fixed a security bug 2025-12-04 18:21:58 +05:30
Aditya Toshniwal d46bce2d7b Fixed an issue where copying highlighted text in the query tool data output cell editor would copy the complete string. #9372
Fixed an issue where copying a single cell should not add quoting. #9373
2025-12-04 16:58:39 +05:30
Akshay Joshi c6406dbaa4 Fixed Javascript test cases. 2025-12-02 16:37:10 +05:30
Dave Page 9c8df1ad3b
React string cleanup. 2025-12-01 16:18:27 +05:30
Dave Page e7db3510e1
Javascript string cleanup (#9405)
* Javascript string cleanup

* Further JS string fixes.
2025-12-01 10:17:30 +00:00
Dave Page 70e4435b04
Python string cleanup
* Python string cleanup
* Fix line lengths
* Further Python string fixes.
2025-12-01 11:06:21 +05:30
Anil Sahoo d6b2379fbe
Fixed an issue where EXPLAIN should run on query under cursor if no text is selected. #9297 2025-11-18 12:17:46 +05:30
Akshay Joshi 60c56b3285 Fixed API test case for restore. 2025-11-10 13:26:42 +05:30
Yogesh Mahajan e374edc692 Fixed Command injection vulnerability allowing arbitrary command execution on Windows (CVE-2025-12763). #9323 2025-11-10 11:27:56 +05:30
Akshay Joshi 1d397395f7 Fixed remote code execution vulnerability when restoring PLAIN-format SQL dumps in server mode (CVE-2025-12762). #9320 2025-11-10 11:27:55 +05:30
Aditya Toshniwal 986ba41ba9
Added the ability to search for tables and automatically bring them into view in the ERD tool. #4306 2025-10-31 12:19:27 +05:30
Aditya Toshniwal 00dbe58125
Add support for formatting .pgerd ERD project file. #8912 2025-10-29 16:22:37 +05:30
Aditya Toshniwal abdcd983f6
Add support for setting image download resolution in the ERD tool. #6698 2025-10-29 14:57:20 +05:30
Akshay Joshi c7a6056ee3 Fixed an issue where Schema Diff does not ignore Tablespace for indexes. #9117 2025-10-28 16:31:39 +05:30
Aditya Toshniwal 37a164cccb
- Rebase pgadmin-org/react-data-grid fork to latest.
- Fixed an issue where data output column resize is not sticking in Safari. #8504
2025-10-27 10:45:36 +05:30
Aditya Toshniwal 0a14db01be
Migrate pgAdmin UI to use React 19. #8676 2025-10-24 08:26:10 +05:30
Aditya Toshniwal 93bbadb994 Fixed an issue where the query tool displayed 'default' instead of 'null' for null text data in the data output. #9098 2025-09-29 12:37:25 +05:30
Aditya Toshniwal 7ff3c4bbeb
Fixed an issue where shortcuts are not working as expected on multiple keyboard layouts. #9157 2025-09-17 11:34:15 +05:30
Aditya Toshniwal 0de635cc4c
Fixed an issue where editor shortcuts fail when using Option key combinations on macOS, due to macOS treating Option+Key as a different key input. #9116 2025-09-01 16:21:03 +05:30
Anil Sahoo 8a4a3814ab
Fixed an issue where custom column widths in the result grid of Query Tool or View/Edit Data were reset after re-executing a query. #7057 2025-08-07 15:32:40 +05:30
Anil Sahoo 2dd27d20c1
Fixed an issue where adding breakpoints caused errors, and stepping out of a nested function removed breakpoints from the parent function. #8982 2025-08-04 16:59:38 +05:30
Pravesh Sharma 829d6323b8
Fixed an issue where CPU usage was very high on Windows when opening the psql tool. #8864 2025-08-01 12:41:16 +05:30
Akshay Joshi 559c6cfa65
Added GENERIC_PLAN, MEMORY, SERIALIZE option to EXPLAIN/EXPLAIN ANALYZE command. #6456 2025-08-01 12:40:07 +05:30
Aditya Toshniwal 99b822e472
Add support for server tag-based filtering in the Object Explorer. #8917 2025-07-31 17:06:40 +05:30
Akshay Joshi 5963593fed Replace keyword PROCEDURE with FUNCTION while creating trigger and event trigger. #6384 2025-07-29 17:48:41 +05:30