@@ -128,6 +128,49 @@ const layerSession = Layer.mergeAll(
128128 TestProviderHost . layer ( ) . pipe ( Layer . provide ( NodeServices . layer ) ) ,
129129) ;
130130
131+ describe ( "AntigravityAdapterV2 compaction" , ( ) => {
132+ it . effect ( "does not expose unsupported manual compaction on the provider session" , ( ) =>
133+ Effect . gen ( function * ( ) {
134+ const childProcessSpawner = yield * ChildProcessSpawner . ChildProcessSpawner ;
135+ const path = yield * Path . Path ;
136+ const crypto = yield * Crypto . Crypto ;
137+ const mockAgentPath = yield * path . fromFileUrl (
138+ new URL ( "../../../scripts/acp-mock-agent.ts" , import . meta. url ) ,
139+ ) ;
140+ const instanceId = ProviderInstanceId . make ( "antigravity-compaction-test" ) ;
141+ const adapter = yield * makeAntigravityAdapterV2 ( {
142+ instanceId,
143+ selfInvocation : yield * resolveSelfInvocation ( ) ,
144+ makeRuntime : ( input ) =>
145+ makeAntigravityAcpRuntime ( {
146+ ...input ,
147+ childProcessSpawner,
148+ spawn : {
149+ command : process . execPath ,
150+ args : [ mockAgentPath ] ,
151+ cwd : input . cwd ,
152+ env : { T3_ACP_ANTIGRAVITY : "1" } ,
153+ } ,
154+ } ) . pipe ( Effect . provideService ( Crypto . Crypto , crypto ) ) ,
155+ withProcess : ( _stop , task ) => task ,
156+ // @effect -diagnostics-next-line effectSucceedWithVoid:off - This optional result requires undefined, not the wider void type.
157+ defaultModel : Effect . succeed ( undefined ) ,
158+ } ) ;
159+ const session = yield * adapter . openSession ( {
160+ threadId : ThreadId . make ( "thread-antigravity-compaction" ) ,
161+ providerSessionId : ProviderSessionId . make ( "provider-session-antigravity-compaction" ) ,
162+ modelSelection : { instanceId, model : "gemini-test-low" } ,
163+ runtimePolicy : ProviderAdapter . ProviderAdapterV2RuntimePolicy . make ( {
164+ runtimeMode : "full-access" ,
165+ interactionMode : "default" ,
166+ cwd : process . cwd ( ) ,
167+ } ) ,
168+ } ) ;
169+ assert . isUndefined ( session . compactThread ) ;
170+ } ) . pipe ( Effect . provide ( layerSession ) , Effect . scoped ) ,
171+ ) ;
172+ } ) ;
173+
131174describe ( "AntigravityAdapterV2 session open" , ( ) => {
132175 it . effect . each ( [
133176 {
0 commit comments