File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,10 @@ class WikiCacheData(BaseModel):
81
81
"""
82
82
wiki_structure : WikiStructureModel
83
83
generated_pages : Dict [str , WikiPage ]
84
- repo : RepoInfo
85
- provider : str
86
- model : str
84
+ repo_url : Optional [str ] = None #compatible for old cache
85
+ repo : Optional [RepoInfo ] = None
86
+ provider : Optional [str ] = None
87
+ model : Optional [str ] = None
87
88
88
89
class WikiCacheRequest (BaseModel ):
89
90
"""
Original file line number Diff line number Diff line change @@ -1526,11 +1526,21 @@ IMPORTANT:
1526
1526
const cachedData = await response . json ( ) ; // Returns null if no cache
1527
1527
if ( cachedData && cachedData . wiki_structure && cachedData . generated_pages && Object . keys ( cachedData . generated_pages ) . length > 0 ) {
1528
1528
console . log ( 'Using server-cached wiki data' ) ;
1529
+ if ( cachedData . mode ) {
1530
+ setSelectedModelState ( cachedData . model ) ;
1531
+ }
1532
+ if ( cachedData . provider ) {
1533
+ setSelectedProviderState ( cachedData . provider ) ;
1534
+ }
1529
1535
1530
- setSelectedModelState ( cachedData . model ) ;
1531
- setSelectedProviderState ( cachedData . provider ) ;
1532
- // Update repoInfo
1533
- setEffectiveRepoInfo ( cachedData . repo ) ;
1536
+ // Update repoInfo
1537
+ if ( cachedData . repo ) {
1538
+ setEffectiveRepoInfo ( cachedData . repo ) ;
1539
+ } else if ( cachedData . repo_url && ! effectiveRepoInfo . repoUrl ) {
1540
+ const updatedRepoInfo = { ...effectiveRepoInfo , repoUrl : cachedData . repo_url } ;
1541
+ setEffectiveRepoInfo ( updatedRepoInfo ) ; // Update effective repo info state
1542
+ console . log ( 'Using cached repo_url:' , cachedData . repo_url ) ;
1543
+ }
1534
1544
1535
1545
// Ensure the cached structure has sections and rootSections
1536
1546
const cachedStructure = {
You can’t perform that action at this time.
0 commit comments