@@ -95,6 +95,11 @@ import {
9595
9696const DEFAULT_GROK_SETTINGS = Schema . decodeSync ( GrokSettings ) ( { } ) ;
9797const DROID_SETTINGS = Schema . decodeSync ( AcpRegistrySettings ) ( { agentId : "factory-droid" } ) ;
98+ const OMP_SETTINGS = Schema . decodeSync ( AcpRegistrySettings ) ( {
99+ source : "local" ,
100+ commandPath : "/usr/local/bin/omp" ,
101+ commandArgs : [ "acp" ] ,
102+ } ) ;
98103
99104const layerHost = TestProviderHost . layer ( ) . pipe ( Layer . provide ( NodeServices . layer ) ) ;
100105
@@ -431,6 +436,67 @@ describe("AcpAdapterV2", () => {
431436
432437 // regression: #20417 Droid AskUser answers were sent as a cancel
433438 it . live . each ( [
439+ ...[
440+ { scenario : "OMP selected option" , answers : { q0 : "Approve" } , content : { q0 : "Approve" } } ,
441+ {
442+ scenario : "OMP custom answer" ,
443+ answers : { q0 : "Please wait" } ,
444+ content : { q0__other : "Please wait" } ,
445+ } ,
446+ { scenario : "OMP cancellation" , answers : undefined , content : undefined } ,
447+ {
448+ scenario : "OMP missing header" ,
449+ answers : { q0 : "Hold" } ,
450+ content : { q0 : "Hold" } ,
451+ withoutHeader : true ,
452+ } ,
453+ {
454+ scenario : "OMP selected label with attachment references" ,
455+ answers : { q0 : 'Approve\n\nAttached file "notes.txt": "/server/notes.txt"' } ,
456+ content : { q0__other : 'Approve\n\nAttached file "notes.txt": "/server/notes.txt"' } ,
457+ } ,
458+ ] . map ( ( fixture ) => ( {
459+ ...fixture ,
460+ settings : OMP_SETTINGS ,
461+ schema : {
462+ type : "object" ,
463+ properties : {
464+ q0 : {
465+ type : "string" ,
466+ title : "Approve this exact code-only commit?" ,
467+ ...( "withoutHeader" in fixture ? { } : { description : "Safety-hook false positive" } ) ,
468+ oneOf : [
469+ { const : "Approve" , title : "Approve" , description : "Commit the verified fix." } ,
470+ { const : "Hold" , title : "Hold" } ,
471+ ] ,
472+ default : "Approve" ,
473+ } ,
474+ q0__other : { type : "string" , title : "Other (type your own)" } ,
475+ } ,
476+ } ,
477+ questions : [
478+ {
479+ id : "q0" ,
480+ header : "withoutHeader" in fixture ? "Question 1" : "Safety-hook false positive" ,
481+ question : "Approve this exact code-only commit?" ,
482+ options : [
483+ { label : "Approve" , value : "Approve" , description : "Commit the verified fix." } ,
484+ { label : "Hold" , value : "Hold" , description : "Hold" } ,
485+ ] ,
486+ } ,
487+ ] ,
488+ result : fixture . content
489+ ? { action : "accept" , content : fixture . content }
490+ : { action : "cancel" } ,
491+ } ) ) ,
492+ {
493+ scenario : "OMP unrelated form uses generic mapping" ,
494+ settings : OMP_SETTINGS ,
495+ schema : { type : "object" , properties : { name : { type : "string" } } } ,
496+ questions : [ { id : "name" , header : "Question 1" , question : "Your answer?" , options : [ ] } ] ,
497+ answers : { name : "Ada" } ,
498+ result : { action : "accept" , content : { name : "Ada" } } ,
499+ } ,
434500 {
435501 scenario : "preserves selected IDs and encodes custom answers" ,
436502 schema : droidSchema ,
@@ -474,8 +540,10 @@ describe("AcpAdapterV2", () => {
474540 answers : { name : "Ada" } ,
475541 result : { action : "accept" , content : { name : "Ada" } } ,
476542 } ,
477- ] ) ( "Droid elicitation $scenario" , ( { schema , questions , answers , result , withAttachments } ) =>
543+ ] ) ( "Registry elicitation $scenario" , ( fixture ) =>
478544 Effect . gen ( function * ( ) {
545+ const { schema, questions, answers, result, settings } = fixture ;
546+ const withAttachments = "withAttachments" in fixture && fixture . withAttachments ;
479547 const fileSystem = yield * FileSystem . FileSystem ;
480548 const path = yield * Path . Path ;
481549 const directory = yield * fileSystem . makeTempDirectoryScoped ( { prefix : "t3-droid-form-" } ) ;
@@ -582,7 +650,7 @@ describe("AcpAdapterV2", () => {
582650 const adapter = yield * makeAcpRegistryAdapterV2 ( {
583651 instanceId,
584652 selfInvocation : yield * resolveSelfInvocation ( ) ,
585- settings : DROID_SETTINGS ,
653+ settings : settings ?? DROID_SETTINGS ,
586654 environment : { } ,
587655 makeRuntime : makeAcpReplayRuntime ( {
588656 transcript,
0 commit comments