Skip to content

Add streaming AI SQL drafts and in-editor review - #156

Draft
amalshaji wants to merge 18 commits into
mainfrom
codex/stream-ai-draft-editor
Draft

Add streaming AI SQL drafts and in-editor review#156
amalshaji wants to merge 18 commits into
mainfrom
codex/stream-ai-draft-editor

Conversation

@amalshaji

@amalshaji amalshaji commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • stream partial SQL from OpenAI, Codex CLI, and Claude Code directly into the query editor's AI draft surface
  • keep AI generation independent per query tab so users can continue working and return when a background draft finishes
  • preserve the current query while reviewing the AI draft, then explicitly replace, append, or discard it
  • let users select part of a query and ask AI to improve only that selection
  • keep the editor toolbar, SQL themes, loading state, and scrolling consistent across light and dark modes

Behavior

  • partial SQL is visible and read-only while generation is in progress
  • the Current / AI draft switch keeps the original SQL available for comparison
  • Discard, Append, and Use in editor appear only after the final response arrives
  • query execution, formatting, and save actions are disabled while the draft surface is active
  • completed background drafts remain scoped to their originating query tab
  • OpenCode uses the same draft flow but currently supplies its response as one final chunk

Implementation

  • adds a typed whole-query/selection edit scope across React and the Tauri command boundary
  • applies completed drafts atomically against the latest query-tab state
  • isolates prompt, toolbar, preview, and SQL-application responsibilities
  • splits harness discovery/process handling from the Claude, Codex, and OpenCode adapters
  • parses provider streams into typed events and preserves fallback final responses

Validation

  • bun run check — 174 tests, typecheck, lint, and production build passed
  • cargo test ai::providers::harness --lib — 6 passed
  • cargo test --manifest-path src-tauri/Cargo.toml --lib — 122 passed, 1 intentionally ignored
  • cargo check --manifest-path src-tauri/Cargo.toml passed
  • exact Tauri development build verified from the feature worktree with an isolated local store
  • thermo-nuclear maintainability review completed with no remaining blockers

Notes

  • cargo clippy --lib -- -D warnings remains blocked by pre-existing warnings in unrelated modules; the changed harness modules introduced no reported clippy finding

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
dbcooper aa2ab82 Commit Preview URL

Branch Preview URL
Jul 29 2026, 02:10 PM

@amalshaji amalshaji changed the title Stream AI-generated SQL drafts in the editor Add streaming AI SQL drafts and in-editor review Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant