Repository navigation
refactor: share the AI provider transport and the core driver scaffolding - #4317
Merged
Merged
Conversation
2 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AI-12 (macOS,
apple/TablePro/Core/AI):AIProviderTransport: one HTTP layer the Claude, OpenAI-compatible, OpenAI Responses and Gemini providers configure (endpoint style, fixed headers, whether 403 means a rejected key). It builds the requests, reads the model list, sorts a connection test's answer and maps HTTP errors.ChatStreamWire: one stream pipeline (error frame, wire parse, empty-reply check, usage) withToolCallTrackerfor tool-call ids. Each provider keeps only its wire mapping:AnthropicStreamWire,ChatCompletionsStreamWire,ResponsesStreamWire(also the ChatGPT backend),GeminiStreamWire.ResponsesEventStreamis gone.OutputLimitSignalTests,ProviderStreamFailureTests,SSEEventStreamTests. TheshouldBreakflag the stream never read is gone; its two cases now check thatdoneends the response.CD-08 (core,
core/crates):tablepro_core::EditorSessionStatusreplaces the run claim copied in ClickHouse, MongoDB, Redis and Cassandra; PostgreSQL wraps it with its transaction state. A Cassandra keyspace move that a close interrupts no longer marks the closed session ready.tablepro_core::deadline_elapsedreplaces the deadline sleep copied across the drivers and the session's health monitor.tablepro_core::ReadEmitterreplaces the exportEmitterin the ClickHouse, PostgreSQL, MySQL, SQL Server and Cassandrastream_read.rs, with the same 256-row batches.WriteBatch::precheckholds the read-only and foreign-key refusal five drivers repeated.RowBatch::MAX_ROWS.Not in this PR: AR-11 (Swift and Rust duplicates of importers, MCP and SSH) and AR-04 (unit tests that need the app host) stay open on the issue for later runs.
Test plan
verify.sh teston the 29 AI provider suites: 285 passed.verify.sh lintandl10npass.cargo test --lib,clippy -D warningsandfmt --checkpass fortablepro-core,tablepro-sessionand the nine drivers; every test target, the Docker suites included, compiles. The Docker suites run in CI.Refs #4274