@@ -430,6 +430,68 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
430430 ) ,
431431 ) ;
432432
433+ it . effect ( "does not guess a version before a custom launcher's first handshake" , ( ) =>
434+ Effect . scoped (
435+ Effect . gen ( function * ( ) {
436+ const harness = yield * makeHarness ( ) ;
437+ yield * Deferred . succeed ( harness . initialProbe , {
438+ ...initializeResult ,
439+ agentInfo : { ...initializeResult . agentInfo , version : "unknown" } ,
440+ } ) ;
441+ yield * harness . initialUpdate ;
442+ expect ( ( yield * harness . provider . snapshot . getSnapshot ) . version ) . toBeNull ( ) ;
443+ } ) ,
444+ ) ,
445+ ) ;
446+
447+ it . effect ( "accepts a known version from a later installation probe" , ( ) =>
448+ Effect . scoped (
449+ Effect . gen ( function * ( ) {
450+ const harness = yield * makeHarness ( ) ;
451+ yield * harness . initialize ;
452+ yield * harness . provider . onSessionStarted ( {
453+ ...started ,
454+ initializeResult : {
455+ ...initializeResult ,
456+ agentInfo : { ...initializeResult . agentInfo , version : "1.3.0" } ,
457+ } ,
458+ } ) ;
459+ yield * Ref . set (
460+ harness . probe ,
461+ Effect . succeed ( {
462+ ...initializeResult ,
463+ agentInfo : { ...initializeResult . agentInfo , version : "1.4.0" } ,
464+ } ) ,
465+ ) ;
466+ expect ( ( yield * harness . provider . snapshot . refresh ) . version ) . toBe ( "1.4.0" ) ;
467+ } ) ,
468+ ) ,
469+ ) ;
470+
471+ it . effect ( "does not replace a handshake version with an unknown custom-launcher probe" , ( ) =>
472+ Effect . scoped (
473+ Effect . gen ( function * ( ) {
474+ const harness = yield * makeHarness ( ) ;
475+ yield * harness . initialize ;
476+ yield * harness . provider . onSessionStarted ( {
477+ ...started ,
478+ initializeResult : {
479+ ...initializeResult ,
480+ agentInfo : { ...initializeResult . agentInfo , version : "1.4.0" } ,
481+ } ,
482+ } ) ;
483+ yield * Ref . set (
484+ harness . probe ,
485+ Effect . succeed ( {
486+ ...initializeResult ,
487+ agentInfo : { ...initializeResult . agentInfo , version : "unknown" } ,
488+ } ) ,
489+ ) ;
490+ expect ( ( yield * harness . provider . snapshot . refresh ) . version ) . toBe ( "1.4.0" ) ;
491+ } ) ,
492+ ) ,
493+ ) ;
494+
433495 it . effect ( "replaces one account's catalog instead of combining accounts" , ( ) =>
434496 Effect . scoped (
435497 Effect . gen ( function * ( ) {
0 commit comments