t8y2/dbx · error · UnsupportedOperationException

Completion assistant search is not supported by this agent

Error message

Completion assistant search is not supported by this agent

What it means

DatabaseAgent's default completionAssistantSearch() is a marker for agents that do not implement the completion-assistant (autocomplete metadata) search capability. Calling it on such an agent throws UnsupportedOperationException immediately, before any lookup is attempted. It signals a capability gap of the specific agent implementation, not a bad request.

Source

Thrown at agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java:73

    default List<ObjectInfo> listObjects(String schema) {
        List<ObjectInfo> result = new ArrayList<>();
        for (TableInfo table : listTables(schema)) {
            result.add(new ObjectInfo(table.getName(), table.getTable_type(), schema, table.getComment()));
        }
        return result;
    }

    default List<ObjectInfo> listObjects(String schema, MetadataListConstraints constraints) {
        return MetadataListConstraints.orNone(constraints).filterObjects(listObjects(schema));
    }

    default List<String> listDataTypes() {
        return Collections.emptyList();
    }

    default CompletionAssistantResponse completionAssistantSearch(CompletionAssistantRequest request) {
        throw new UnsupportedOperationException("Completion assistant search is not supported by this agent");
    }

    List<ColumnInfo> getColumns(String schema, String table);

    default ObjectSource getObjectSource(String schema, String name, String objectType) {
        throw new UnsupportedOperationException("Object source is not supported");
    }

    default String getTableDdl(String schema, String table) {
        List<IndexInfo> indexes;
        try {
            indexes = listIndexes(schema, table);
        } catch (RuntimeException e) {
            indexes = Collections.emptyList();
        }

        List<ForeignKeyInfo> foreignKeys;
        try {

View on GitHub (pinned to c0390bff16)

Solutions

  1. Check agent capability before calling: only invoke completionAssistantSearch on agent implementations that override it (feature-detect via instanceof or a capability flag).
  2. Update/upgrade the agent implementation for that database to implement completionAssistantSearch.
  3. Return an empty completion result / disable the completion feature for this connection instead of calling the default method.

Example fix

// before
List<String> hints = agent.completionAssistantSearch(request).getSuggestions();
// after
if (!(agent instanceof CompletionSearchCapable)) {
    return CompletionAssistantResponse.empty();
}
List<String> hints = agent.completionAssistantSearch(request).getSuggestions();
Defensive patterns

Strategy: fallback

Validate before calling

boolean supported = !(agent.getClass().getInterface... ) // or: check agent instanceof CompletionSearchCapable before calling
if (agent instanceof CompletionSearchCapable) { /* safe to call */ }

Type guard

static boolean supportsCompletionSearch(DatabaseAgent a) {
    return a instanceof CompletionSearchCapable;
}

Try / catch

try {
    return agent.completionAssistantSearch(request);
} catch (UnsupportedOperationException e) {
    return CompletionAssistantResponse.empty(); // feature disabled for this agent
}

Prevention

When it happens

Trigger: Calling completionAssistantSearch(request) on a DatabaseAgent implementation that does not override the default method (only agents implementing completion search override it, e.g. those with dictionary/catalog search support).

Common situations: A UI autocomplete or completion-assistant feature wired generically over all database types is invoked for a database whose agent (e.g. a minimal or older driver) never implemented completionAssistantSearch; switching a connection to a database type that lacks the feature.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/1c1cb4584c16963b. Report an issue: GitHub.