@@ -383,6 +383,8 @@ window.__ModuleLoader__.load({
383383 "memory.features.modelTestOk" : "连通正常" ,
384384 "memory.features.modelTestFail" : "测试失败" ,
385385 "memory.features.modelTestHint" : "真实发起一次最小巩固调用,验证 Provider/模型连通与 effort 支持" ,
386+ "memory.features.routeStaleMark" : "(不在可用列表)" ,
387+ "memory.features.routeStaleHint" : "不在当前可用列表,多为切换 Provider 后的旧值:请改选,或点「测试连通性」当场验证;改动保存后重启 DSH 生效。" ,
386388 "memory.explorer.viewCards" : "卡片" ,
387389 "memory.explorer.viewTimeline" : "时间线" ,
388390 "memory.explorer.viewAria" : "视图切换" ,
@@ -734,6 +736,8 @@ window.__ModuleLoader__.load({
734736 "memory.features.modelTestOk" : "Connected" ,
735737 "memory.features.modelTestFail" : "Test failed" ,
736738 "memory.features.modelTestHint" : "Fires one minimal consolidation call to verify provider/model connectivity and effort support" ,
739+ "memory.features.routeStaleMark" : " (not in list)" ,
740+ "memory.features.routeStaleHint" : "Not in the currently available list, often a leftover from a provider switch: reselect, or run a connectivity test to verify now; changes take effect after restarting DSH." ,
737741 "memory.explorer.viewCards" : "Cards" ,
738742 "memory.explorer.viewTimeline" : "Timeline" ,
739743 "memory.explorer.viewAria" : "Switch view" ,
@@ -1903,14 +1907,21 @@ window.__ModuleLoader__.load({
19031907 // 巩固/睡眠路由行:provider/model 级联下拉(数据来自宿主侧已注册的
19041908 // 适配器,用户不会选到不存在的模型)+ 连通性测试。空值 = 跟随默认
19051909 // 路由;改动即提交(与 embedProvider 下拉一致)。当前值不在枚举里时
1906- // 保留为额外选项,避免静默改值 。
1910+ // 保留为额外选项避免静默改值,并显式标记 + 行级提示(issue #191) 。
19071911 const routeSelects = ( providerKey , modelKey , testState , setTestState ) => {
19081912 const curP = strs [ providerKey ] ?? "" ;
19091913 const curM = strs [ modelKey ] ?? "" ;
19101914 const entries = Array . isArray ( routes ) ? routes : [ ] ;
19111915 const entry = entries . find ( ( p ) => p && p . provider === curP ) ;
19121916 const models = ( entry && Array . isArray ( entry . models ) ) ? entry . models : [ ] ;
19131917 const mVals = models . map ( modelValue ) ;
1918+ // issue #191:旧值保留是刻意不丢配置,但必须看得见。适配器列表为空
1919+ // (端点刚起 / 宿主零适配器)时无从比对,不标记防误报;provider 未
1920+ // 选或本身不在列表时,模型归属由后端按默认路由解析,前端不校验
1921+ // model——只在 provider 已注册时查配套。
1922+ const hasProviders = entries . length > 0 ;
1923+ const pStale = hasProviders && ! ! curP && ! entry ;
1924+ const mStale = hasProviders && ! ! entry && ! ! curM && ! mVals . includes ( curM ) ;
19141925 const pList = entries . map ( ( p ) => p . provider ) . concat (
19151926 curP && ! entries . some ( ( p ) => p . provider === curP ) ? [ curP ] : [ ] ) ;
19161927 const putKey = ( key ) => ( e ) => {
@@ -1926,7 +1937,8 @@ window.__ModuleLoader__.load({
19261937 "aria-label" : t ( `memory.features.${ providerKey } ` ) , onChange : putKey ( providerKey )
19271938 } ,
19281939 h ( "option" , { value : "" } , t ( "memory.features.routeFollowDefault" ) ) ,
1929- pList . map ( ( p ) => h ( "option" , { key : p , value : p } , p ) ) ) ) ,
1940+ pList . map ( ( p ) => h ( "option" , { key : p , value : p } ,
1941+ pStale && p === curP ? p + t ( "memory.features.routeStaleMark" ) : p ) ) ) ) ,
19301942 h ( "div" , { className : "mneme-featnum" } ,
19311943 h ( "span" , { className : "mneme-featnumlabel" } , t ( `memory.features.${ modelKey } ` ) ) ,
19321944 h ( "select" , {
@@ -1935,17 +1947,23 @@ window.__ModuleLoader__.load({
19351947 } ,
19361948 h ( "option" , { value : "" } , t ( "memory.features.routeFollowDefault" ) ) ,
19371949 models . map ( ( m , i ) => h ( "option" , { key : modelValue ( m ) + "|" + i , value : modelValue ( m ) } , modelLabel ( m ) ) ) ,
1938- curM && ! mVals . includes ( curM ) ? h ( "option" , { key : "current" , value : curM } , curM ) : null ) ) ,
1950+ curM && ! mVals . includes ( curM ) ? h ( "option" , { key : "current" , value : curM } ,
1951+ mStale ? curM + t ( "memory.features.routeStaleMark" ) : curM ) : null ) ) ,
1952+ ( pStale || mStale ) && h ( "div" , { className : "mneme-featsubhint" } ,
1953+ "⚠ " + t ( "memory.features.routeStaleHint" ) ) ,
19391954 h ( "div" , { className : "mneme-featnum" } ,
19401955 h ( "button" , {
19411956 type : "button" , className : "mneme-btn" ,
19421957 disabled : busy || ( testState && testState . running ) ,
19431958 onClick : ( ) => runModelTest ( curP , curM , setTestState )
19441959 } , t ( ( testState && testState . running ) ? "memory.features.modelTesting" : "memory.features.modelTest" ) ) ,
1945- testState && ! testState . running && h ( "div" , { className : "mneme-featsubhint" } ,
1946- ( testState . ok ? "✓ " + t ( "memory.features.modelTestOk" ) : "✗ " + t ( "memory.features.modelTestFail" ) )
1947- + ( typeof testState . ms === "number" ? " · " + ( testState . ms / 1000 ) . toFixed ( 1 ) + "s" : "" )
1948- + ( testState . detail ? " · " + testState . detail : "" ) ) )
1960+ // 结果与说明共用同一行槽位二选一:出结果后说明自动让位,不堆叠。
1961+ ( testState && ! testState . running
1962+ ? h ( "div" , { className : "mneme-featsubhint" } ,
1963+ ( testState . ok ? "✓ " + t ( "memory.features.modelTestOk" ) : "✗ " + t ( "memory.features.modelTestFail" ) )
1964+ + ( typeof testState . ms === "number" ? " · " + ( testState . ms / 1000 ) . toFixed ( 1 ) + "s" : "" )
1965+ + ( testState . detail ? " · " + testState . detail : "" ) )
1966+ : h ( "div" , { className : "mneme-featsubhint" } , t ( "memory.features.modelTestHint" ) ) ) )
19491967 ) ;
19501968 } ;
19511969
0 commit comments