@@ -2897,8 +2897,8 @@ describe("adeRpcServer", () => {
28972897 } ) ;
28982898
28992899 it ( "rejects run_ade_action when the action is not a callable on the domain service" , async ( ) => {
2900- const { runtime , operationStart , operationFinish } = createRuntime ( ) ;
2901- const handler = createAdeRpcRequestHandler ( { runtime, serverVersion : "test" } ) ;
2900+ const fixture = createRuntime ( ) ;
2901+ const handler = createAdeRpcRequestHandler ( { runtime : fixture . runtime , serverVersion : "test" } ) ;
29022902 await initialize ( handler , { callerId : "agent-1" , role : "agent" } ) ;
29032903
29042904 const response = await callTool ( handler , "run_ade_action" , {
@@ -2911,11 +2911,6 @@ describe("adeRpcServer", () => {
29112911 expect ( JSON . stringify ( response . error ?? response . structuredContent ?? { } ) ) . toContain (
29122912 "Action 'git.nonexistent_action' is not callable." ,
29132913 ) ;
2914- expect ( operationStart ) . toHaveBeenCalledTimes ( 1 ) ;
2915- expect ( operationFinish ) . toHaveBeenCalledWith ( expect . objectContaining ( {
2916- status : "failed" ,
2917- metadataPatch : expect . objectContaining ( { resultStatus : "error" } ) ,
2918- } ) ) ;
29192914 } ) ;
29202915
29212916 it ( "reads ADE action status snapshots across operation/test/chat/pr" , async ( ) => {
@@ -3059,45 +3054,6 @@ describe("adeRpcServer", () => {
30593054 expect ( operationFinish ) . not . toHaveBeenCalled ( ) ;
30603055 } ) ;
30613056
3062- it ( "does not mask successful action responses when audit finish fails" , async ( ) => {
3063- const { runtime, operationFinish } = createRuntime ( ) ;
3064- operationFinish . mockImplementationOnce ( ( ) => {
3065- throw new Error ( "finish failed" ) ;
3066- } ) ;
3067- const handler = createAdeRpcRequestHandler ( { runtime, serverVersion : "test" } ) ;
3068-
3069- await initialize ( handler ) ;
3070- const response = await callTool ( handler , "list_lanes" , { } ) ;
3071-
3072- expect ( response . isError ) . toBeUndefined ( ) ;
3073- expect ( response . structuredContent . lanes ) . toHaveLength ( 2 ) ;
3074- expect ( operationFinish ) . toHaveBeenCalledTimes ( 1 ) ;
3075- expect ( runtime . logger . warn ) . toHaveBeenCalledWith (
3076- "ade_rpc.action_audit_finish_failed" ,
3077- expect . objectContaining ( { actionName : "list_lanes" , status : "succeeded" } ) ,
3078- ) ;
3079- } ) ;
3080-
3081- it ( "records failed audit metadata for returned action failure payloads" , async ( ) => {
3082- const { runtime, operationFinish } = createRuntime ( ) ;
3083- runtime . gitService . push . mockResolvedValueOnce ( { success : false , error : "push failed" } ) ;
3084- const handler = createAdeRpcRequestHandler ( { runtime, serverVersion : "test" } ) ;
3085-
3086- await initialize ( handler , { callerId : "agent-1" , role : "agent" } ) ;
3087- const response = await callTool ( handler , "run_ade_action" , {
3088- domain : "git" ,
3089- action : "push" ,
3090- args : { laneId : "lane-1" } ,
3091- } ) ;
3092-
3093- expect ( response . isError ) . toBeUndefined ( ) ;
3094- expect ( response . structuredContent . result . success ) . toBe ( false ) ;
3095- expect ( operationFinish ) . toHaveBeenCalledWith ( expect . objectContaining ( {
3096- status : "failed" ,
3097- metadataPatch : expect . objectContaining ( { resultStatus : "error" , error : "push failed" } ) ,
3098- } ) ) ;
3099- } ) ;
3100-
31013057 // ---------- Rate limit tests ----------
31023058
31033059 afterEach ( ( ) => {
0 commit comments