{"record":{"id":"1c1cb4584c16963b","repo":"t8y2/dbx","slug":"completion-assistant-search-is-not-supported-by-th-1c1cb4","errorCode":null,"errorMessage":"Completion assistant search is not supported by this agent","messagePattern":"Completion assistant search is not supported by this agent","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java","lineNumber":73,"sourceCode":"\n    default List<ObjectInfo> listObjects(String schema) {\n        List<ObjectInfo> result = new ArrayList<>();\n        for (TableInfo table : listTables(schema)) {\n            result.add(new ObjectInfo(table.getName(), table.getTable_type(), schema, table.getComment()));\n        }\n        return result;\n    }\n\n    default List<ObjectInfo> listObjects(String schema, MetadataListConstraints constraints) {\n        return MetadataListConstraints.orNone(constraints).filterObjects(listObjects(schema));\n    }\n\n    default List<String> listDataTypes() {\n        return Collections.emptyList();\n    }\n\n    default CompletionAssistantResponse completionAssistantSearch(CompletionAssistantRequest request) {\n        throw new UnsupportedOperationException(\"Completion assistant search is not supported by this agent\");\n    }\n\n    List<ColumnInfo> getColumns(String schema, String table);\n\n    default ObjectSource getObjectSource(String schema, String name, String objectType) {\n        throw new UnsupportedOperationException(\"Object source is not supported\");\n    }\n\n    default String getTableDdl(String schema, String table) {\n        List<IndexInfo> indexes;\n        try {\n            indexes = listIndexes(schema, table);\n        } catch (RuntimeException e) {\n            indexes = Collections.emptyList();\n        }\n\n        List<ForeignKeyInfo> foreignKeys;\n        try {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java#L55-L91","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check agent capability before calling: only invoke completionAssistantSearch on agent implementations that override it (feature-detect via instanceof or a capability flag).","Update/upgrade the agent implementation for that database to implement completionAssistantSearch.","Return an empty completion result / disable the completion feature for this connection instead of calling the default method."],"exampleFix":"// before\nList<String> hints = agent.completionAssistantSearch(request).getSuggestions();\n// after\nif (!(agent instanceof CompletionSearchCapable)) {\n    return CompletionAssistantResponse.empty();\n}\nList<String> hints = agent.completionAssistantSearch(request).getSuggestions();","handlingStrategy":"fallback","validationCode":"boolean supported = !(agent.getClass().getInterface... ) // or: check agent instanceof CompletionSearchCapable before calling\nif (agent instanceof CompletionSearchCapable) { /* safe to call */ }","typeGuard":"static boolean supportsCompletionSearch(DatabaseAgent a) {\n    return a instanceof CompletionSearchCapable;\n}","tryCatchPattern":"try {\n    return agent.completionAssistantSearch(request);\n} catch (UnsupportedOperationException e) {\n    return CompletionAssistantResponse.empty(); // feature disabled for this agent\n}","preventionTips":["Maintain a capability interface (e.g. CompletionSearchCapable) and feature-detect before calling optional interface methods.","Keep UI autocomplete actions disabled for database types whose agent lacks completion search.","Add tests asserting default methods are only reachable for agents that intentionally skip the feature."],"tags":["unsupported-operation","capability","autocomplete"],"backgroundTag":"feature-not-supported","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}