Skip to content

Commit 8ddcbd2

Browse files
committed
fix: update version export in ContextItems to use class version
refactor: simplify vector initialization in SmartEntity
1 parent 65ad5e0 commit 8ddcbd2

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

smart-blocks/content_parsers/parse_blocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function clean_and_update_source_blocks(source, blocks_obj, task_lines=[], tasks
117117
for(let i = 0; i < blocks.length; i++){
118118
if(!current_block_keys.has(blocks[i].key)){
119119
blocks[i].deleted = true;
120-
blocks[i].queue_save();
120+
blocks[i].queue_save();
121121
}
122122
}
123123
// Update source data with new blocks

smart-contexts/context_items.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class ContextItems extends Collection {
9393
}
9494

9595
export default {
96-
version: 1,
96+
version: ContextItems.version,
9797
class: ContextItems,
9898
collection_key: 'context_items',
9999
item_type: ContextItem,

smart-entities/smart_entity.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export class SmartEntity extends CollectionItem {
5555
*/
5656
init() {
5757
super.init();
58-
if (!this.vec || !this.vec.length){
59-
this.vec = null;
58+
if (!this.vec?.length){
59+
this.entity_adapter.vec = null;
6060
this.queue_embed();
6161
}
6262
// Only keep active model embeddings
@@ -118,12 +118,12 @@ export class SmartEntity extends CollectionItem {
118118
if(!this.embedding_data.last_embed){
119119
this.embedding_data.last_embed = {};
120120

121-
// temporary for backwards compatibility
122-
if(this.data.last_embed){
123-
this.embedding_data.last_embed = this.data.last_embed;
124-
delete this.data.last_embed;
125-
this.queue_save();
126-
}
121+
// // temporary for backwards compatibility (removed 2026-03-25)
122+
// if(this.data.last_embed){
123+
// this.embedding_data.last_embed = this.data.last_embed;
124+
// delete this.data.last_embed;
125+
// this.queue_save();
126+
// }
127127
}
128128
return this.embedding_data.last_embed;
129129
}

0 commit comments

Comments
 (0)