@@ -67,10 +67,11 @@ class SimpleCache {
6767
6868 if ( ! params ?. skipTrace ) {
6969 // Also run the action
70- // This returns metadata and shows up in dev UI
70+ // This action actually does nothing, with the important side
71+ // effect of logging its input and output (which are the same).
7172 // It does not change what we return, it just makes
72- // the content of the DAP visible in the trace.
73- await this . dap . run ( this . value ) ;
73+ // the content of the DAP visible in the DevUI and logging trace.
74+ await this . dap . run ( transformDapValue ( this . value ) ) ;
7475 }
7576 return this . value ;
7677 } catch ( error ) {
@@ -170,12 +171,16 @@ export function defineDynamicActionProvider(
170171 metadata : { ...( cfg . metadata || { } ) , type : 'dynamic-action-provider' } ,
171172 } ,
172173 async ( i , _options ) => {
173- // The actions are retrieved and saved in a cache and then passed in here.
174- // We run this action to return the metadata for the actions only.
175- // We pass the actions in here to prevent duplicate calls to the mcp
176- // and also so we are guaranteed the same actions since there is only a
177- // single call to mcp client/host.
178- return transformDapValue ( i ) ;
174+ // The actions are retrieved, saved in a cache, formatted nicely and
175+ // then passed in here so they can be automatically logged by the action
176+ // call. This action is for logging only. We cannot run the actual
177+ // 'getting the data from the DAP' here because the DAP data is required
178+ // to resolve tools/resources etc. And there can be a LOT of tools etc.
179+ // for a single generate. Which would log one DAP action per resolve,
180+ // and unnecessarily overwhelm the Dev UI with DAP actions that all have
181+ // the same information. So we only run this action (for the logging) when
182+ // we go get new data from the DAP (so we can see what it returned).
183+ return i ;
179184 }
180185 ) ;
181186 implementDap ( a as DynamicActionProviderAction , cfg , fn ) ;
0 commit comments