Skip to content

Commit

Permalink
fix(runtimes/external-store): switch to thread should correctly copy …
Browse files Browse the repository at this point in the history
…the entire store (#857)
  • Loading branch information
Yonom authored Sep 19, 2024
1 parent c8680d5 commit eac9c1b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export class ExternalStoreRuntime extends BaseAssistantRuntime<ExternalStoreThre
throw new Error("Runtime does not support switching to new threads.");

this.thread = new ExternalStoreThreadRuntime({
...this.store,
messages: [],
onNew: this.store.onNew,
});
await this.store.onSwitchToNewThread();
}
Expand All @@ -43,8 +43,8 @@ export class ExternalStoreRuntime extends BaseAssistantRuntime<ExternalStoreThre
throw new Error("Runtime does not support switching threads.");

this.thread = new ExternalStoreThreadRuntime({
messages: [],
onNew: this.store.onNew,
...this.store,
messages: [], // ignore messages until rerender
});
this.store.onSwitchToThread(threadId);
} else {
Expand Down

0 comments on commit eac9c1b

Please sign in to comment.