Skip to content

Feature/notebooks ai agent v02#256

Draft
Nuri1977 wants to merge 3 commits into
devfrom
feature/notebooks-ai-agent-v02
Draft

Feature/notebooks ai agent v02#256
Nuri1977 wants to merge 3 commits into
devfrom
feature/notebooks-ai-agent-v02

Conversation

@Nuri1977
Copy link
Copy Markdown
Contributor

@Nuri1977 Nuri1977 commented May 20, 2026

feat(notebooks): integrate AI agent with full notebook-native tool support
This commit implements the complete Notebooks Agent architecture, enabling the AI agent to autonomously read, author, and execute cells within the Notebooks screen.

Key features and architectural updates:

  • Global AI Toggle: Extended the Main Header Menu to support the AI bot icon on the Notebooks screen, migrating legacy local state to the global isChatOpen context.

  • Notebook-Scoped Sessions: Updated ChatWindow to scope chat sessions dynamically by connectionId and notebookId, ensuring sessions automatically swap or auto-create when changing active tabs or database connections.

  • Renderer Bridge Service: Implemented notebookBridge.service.ts to establish a secure IPC bridge, exposing renderer-side UI functions (read cell, update cell, run cell, fetch result) to the main-process agent.

  • Agent Tools Registration: Created notebooks.tools.ts exposing five new agent tools (get_state, cell_read, cell_update, cell_run, cell_result) with integrated DML/DDL permission gates and Ask-mode read-only enforcement.

  • System Prompt Enhancement: Injected a dynamic summary of the active notebook's state directly into the agent's initialization prompt, granting instant context awareness without requiring an initial tool call.

  • Deterministic Pagination: Hardened backend execution to safely strip explicit LIMIT clauses written by the agent, enforcing stable, native server-side pagination for large datasets to prevent UI memory crashes.

  • Add disabledReason prop to ChatInputBox to block input and associated UI actions

  • Implement scope-based chat restrictions for notebooks requiring a valid connection and the notebook

  • Conditionally fetch chat sessions only when the scope is valid

  • Update ChatMessageList empty states to use icon bullets and improved centered layout

  • Remove unused active connection data fetch in ChatWindow

  • Sync disabled state across all chat buttons, inputs, and tooltips

This integration unblocks complex, multi-step autonomous data engineering workflows directly within the Notebooks UI.

Nuri1977 added 3 commits May 17, 2026 02:58
…pport

This commit implements the complete Notebooks Agent architecture (Plan 32), enabling the AI agent to autonomously read, author, and execute cells within the Notebooks screen.

Key features and architectural updates:
- **Global AI Toggle**: Extended the Main Header Menu to support the AI bot icon on the Notebooks screen, migrating legacy local state to the global `isChatOpen` context.
- **Notebook-Scoped Sessions**: Updated `ChatWindow` to scope chat sessions dynamically by `connectionId` and `notebookId`, ensuring sessions automatically swap or auto-create when changing active tabs or database connections.
- **Renderer Bridge Service**: Implemented `notebookBridge.service.ts` to establish a secure IPC bridge, exposing renderer-side UI functions (read cell, update cell, run cell, fetch result) to the main-process agent.
- **Agent Tools Registration**: Created `notebooks.tools.ts` exposing five new agent tools (`get_state`, `cell_read`, `cell_update`, `cell_run`, `cell_result`) with integrated DML/DDL permission gates and Ask-mode read-only enforcement.
- **System Prompt Enhancement**: Injected a dynamic summary of the active notebook's state directly into the agent's initialization prompt, granting instant context awareness without requiring an initial tool call.
- **Deterministic Pagination**: Hardened backend execution to safely strip explicit `LIMIT` clauses written by the agent, enforcing stable, native server-side pagination for large datasets to prevent UI memory crashes.

This integration unblocks complex, multi-step autonomous data engineering workflows directly within the Notebooks UI.
Add disabledReason prop to ChatInputBox to block input and associated UI actions
Implement scope-based chat restrictions for notebooks requiring valid connection and notebook
Conditionally fetch chat sessions only when scope is valid
Update ChatMessageList empty states to use icon bullets and improved centered layout
Remove unused active connection data fetch in ChatWindow
Sync disabled state across all chat buttons, inputs and tooltips
@Nuri1977 Nuri1977 self-assigned this May 20, 2026
@Nuri1977 Nuri1977 added the enhancement New feature or request label May 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@Nuri1977 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 41 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9236a43-cabe-433e-8015-f2e725aa791e

📥 Commits

Reviewing files that changed from the base of the PR and between 473d27e and d648534.

📒 Files selected for processing (26)
  • src/main/ipcHandlers/agent.ipcHandlers.ts
  • src/main/ipcHandlers/ai.ipcHandlers.ts
  • src/main/schemas/mainDatabase.schema.ts
  • src/main/services/agent.service.ts
  • src/main/services/ai/agents/notebooksAgent.ts
  • src/main/services/ai/agents/sqlAgent.ts
  • src/main/services/ai/tools/studio/notebooks.tools.ts
  • src/main/services/ai/tools/studio/sql.tools.ts
  • src/main/services/ai/tools/toolRegistry.ts
  • src/main/services/mainDatabase.service.ts
  • src/main/services/notebooks.service.ts
  • src/renderer/components/chat/ChatInputBox.tsx
  • src/renderer/components/chat/ChatMessageList.tsx
  • src/renderer/components/chat/ChatWindow.tsx
  • src/renderer/components/menu/index.tsx
  • src/renderer/components/notebook/NotebookEditor.tsx
  • src/renderer/components/settings/AISettingsTab.tsx
  • src/renderer/controllers/chat.controller.ts
  • src/renderer/controllers/notebooks.controller.ts
  • src/renderer/hooks/useAgentStream.ts
  • src/renderer/hooks/useNotebookBridge.ts
  • src/renderer/screens/notebooks/index.tsx
  • src/renderer/services/agent.service.ts
  • src/renderer/services/chat.service.ts
  • src/renderer/services/notebookBridge.service.ts
  • src/types/ipc.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/notebooks-ai-agent-v02

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Nuri1977 Nuri1977 marked this pull request as draft May 21, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant