Skip to content

feat: consolidate DM8 and DM8Oracle into single Dameng type + fixes#110

Merged
Blankll merged 9 commits into
masterfrom
fix/agent-self-healing-and-timeout
Jun 20, 2026
Merged

feat: consolidate DM8 and DM8Oracle into single Dameng type + fixes#110
Blankll merged 9 commits into
masterfrom
fix/agent-self-healing-and-timeout

Conversation

@Blankll

@Blankll Blankll commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

The DM8 connection was previously split into two separate types: DM8 (using MySQL wire protocol via the Rust MySQL adapter) and DM8Oracle (using JDBC bridge with the Dameng JDBC driver). This was confusing — users had to know which compatibility mode their server was running, and the MySQL-wire path had zero Dameng-specific code. The official Dameng JDBC driver (DmJdbcDriver8) handles all connection modes through a single protocol, so we now use it exclusively.

Also fixes several issues discovered while testing DM8 connectivity end-to-end.

Changes

DM8 Type Consolidation (backend)

  • Merged DatabaseType::DM8 and DatabaseType::DM8Oracle into a single DatabaseType::Dameng
  • All DM connections now route through the JDBC bridge
  • Removed CoreDatabaseType::DM8Oracle — it's not a core adapter type
  • Fixed JDBC artifact name from DmJdbcDriver (nonexistent on Maven Central) to DmJdbcDriver8 (latest: 8.1.5.45)
  • Backward compatible: all old aliases (dm, dm8, dm8_oracle, dm8oracle) still resolve to Dameng

DM8 Type Consolidation (frontend)

  • Collapsed two enum values (DM8, DM8ORACLE) into one (DAMENG)
  • Single entry in the connection type selector with one icon
  • SQL formatter now uses plsql dialect (matches the JDBC bridge's Oracle-compatible mode)
  • Updated i18n keys, SSL labels, data studio agent source types
  • Removed unused dm8oracle-logo.svg asset

JDBC Bridge: Multi-Statement SQL Splitting

The Dameng JDBC driver rejects ;-separated statements in a single execute() call. When the data studio agent generates SQL like:

CREATE TABLE t (...);
COMMENT ON TABLE t IS '...';
COMMENT ON COLUMN t.id IS '...';

...the driver returns "Syntax error" on the second statement. Added split_sql_statements() in the JDBC bridge adapter that splits multi-statement SQL on ; (respecting string literals, quoted identifiers, and comments) and executes each statement individually via the bridge.

JDBC Bridge: list_connections Resilience

sqlkit__list_connections was failing intermittently during parallel tool calls because TauriStoreReader propagated errors from the Tauri plugin store directly. Changed to return an empty connection list on store errors instead of failing, so the agent can continue working.

Database Browser: Schema Support for All Schema-Aware Databases

The supportsSchemas flag was hardcoded to only PostgreSQL and SQL Server, hiding the schema selector for Dameng (12 schemas available), Oracle, DB2, H2, and other JDBC databases with schemas. Changed to a data-driven check — if fetchSchemas returns any schemas, the schema selector appears and tables are grouped under their schema. Falls back to flat table listing for MySQL-family databases that don't have schemas.

Database Browser: Synthetic Entry for Single-Database Systems

Dameng, Oracle, and similar databases don't support listing multiple databases — listDatabases returns empty. When no current database is known, the store now creates a synthetic entry using the connection name so the tree structure and database selector still work.

DataGrid: Actions Column in Query Results

The Actions column (copy row, edit, delete, export) was gated by v-if="connectionId && tableName", hiding it in query result panels where tableName is never set. Changed to v-if="connectionId" so the actions menu is available for ad-hoc query results too.

Connection State Preservation Across Page Navigation

The Connections page calls fetchConnections() on mount, which replaces the entire connections array with data from the backend config store. The backend doesn't track runtime connection state (isConnected), so all connections appeared disconnected even when actively connected in other tabs. fetchConnections now preserves isConnected from existing store entries.

Testing

  • ✅ Rust unit tests: 263 passed
  • ✅ Frontend tests: 415 passed
  • ✅ vue-tsc --noEmit: exit 0
  • ✅ Manual JDBC bridge connection verified against DM8 8.1.5.8 at 10.84.1.212:5236
  • ✅ Single-statement COMMENT ON TABLE/COLUMN verified working
  • ✅ Multi-statement SQL (CREATE TABLE + multiple COMMENTS) now works via splitting
  • ✅ SQL splitting unit tests cover: semicolons in strings, comments, quoted identifiers, empty statements, complex DDL

Blankll and others added 7 commits June 20, 2026 21:41
Backend (Rust):
- lib.rs: manage AppState directly, not Arc<AppState> (Tauri TypeId mismatch)
- capabilities/sql.rs: 35 adapter arms for JdbcBridge/ClickHouse/HttpSql/Rqlite/Turso
- capabilities/sql.rs: get_schema capped at 30 tables to prevent N+1 timeout on Oracle
- capabilities/sql.rs: tool descriptions improved (list_tables for existence, get_schema for DDL)
- jdbc_bridge/adapter.rs: spawn_blocking for pipe reads so tokio::time::timeout works
- deps: data-studio-agent upgraded to v0.1.2 (self-healing, tool timeout, message ordering)

Frontend (Vue/TS):
- agent-message-bubble.vue: tool errors auto-expand, retry text shown inline
- chat-panel.vue: removed floating status bar, cleaned up props
- agentRuntime.ts: tool retry event handler with inline status
- agentRuntime.ts: context-usage tracking wired
- useChatAgent.ts: system prompt hardened with tool usage rules
- agentApi.ts: onAgentLoopToolRetry event
- dataStudioStore.ts: session tracking fields (startTime, tokenUsage, activeTool)
Root cause: JDBC getCatalogs() returns empty for Oracle, so the
frontend database selector had no options and the tree was empty.

Changes:
- jdbc-bridge: Add Oracle fallback in MetadataProvider.listDatabases()
  using SYS_CONTEXT('USERENV', 'CON_NAME') and v queries when
  getCatalogs() returns empty
- frontend: Add defensive fallback in databaseStore.fetchDatabases()
  to synthesize a database entry from the connection's configured
  database when the backend returns an empty list
Merge the two separate database type variants (DM8 for MySQL-wire protocol, DM8Oracle for JDBC bridge) into a single Dameng variant that routes exclusively through the JDBC bridge using the official Dameng JDBC driver (com.dameng:DmJdbcDriver8).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Collapse DM8 and DM8ORACLE enum values into DAMENG. Update connection form, database icons, SQL formatter dialect (plsql), data studio agent sources, SSL labels, and translation keys. Remove unused dm8oracle-logo.svg. Preserve isConnected across fetchConnections for accurate active-session display.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… resilient

Add split_sql_statements() to the JDBC bridge adapter so multi-statement SQL (e.g. CREATE TABLE; COMMENT ON) is executed individually. The Dameng JDBC driver rejects ;-separated statements in a single execute() call. Also make list_connections fallback to an empty list instead of propagating store errors.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…lumn in query results

Make supportsSchemas data-driven (checks actual schema data) instead of hardcoded to PostgreSQL and SQL Server, so Dameng/Oracle/DB2 users can browse schemas. Show the DataGrid Actions column (copy, edit, delete) in query result panels, not just table views. Add synthetic database entry when listDatabases returns empty.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Move Dameng from MySQL-wire to JDBC bridge table. Rename DM8 to Dameng to be version-agnostic.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@Blankll Blankll changed the title fix: agent self-healing, tool timeout, JDBC bridge hang, UI polish feat: consolidate DM8 and DM8Oracle into single Dameng type + fixes Jun 20, 2026
Blankll and others added 2 commits June 21, 2026 00:08
Accumulate rows_affected across DML statements and preserve the last SELECT result. Document that multi-statement execution is in autocommit mode (no transaction wrapping).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@Blankll Blankll merged commit cd64e25 into master Jun 20, 2026
3 checks passed
@Blankll Blankll deleted the fix/agent-self-healing-and-timeout branch June 20, 2026 16:17
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