@@ -68,7 +68,7 @@ type LocalHandler struct {
6868 expectedGameID string // Agent 配置的 gameId,用于校验 SDK 注册
6969 expectedEnv string // Agent 配置的 env,用于校验 SDK 注册
7070 // providerCallTimeout 是 Agent → Provider 同步调用的默认预算;
71- // 请求 metadata["timeout_ms "] 声明更小值时取更小者(Go deadline
71+ // 请求 metadata["timeoutMs "] 声明更小值时取更小者(Go deadline
7272 // min 语义)。此前硬编码 10s 与 Server 派发层 15s 倒挂。
7373 providerCallTimeout time.Duration
7474 mu sync.RWMutex
@@ -124,7 +124,7 @@ func (h *LocalHandler) providerCallDeadline(meta map[string]string) time.Duratio
124124 if def <= 0 {
125125 def = 15 * time .Second
126126 }
127- raw := strings .TrimSpace (meta ["timeout_ms " ])
127+ raw := strings .TrimSpace (meta ["timeoutMs " ])
128128 if raw == "" {
129129 return def
130130 }
@@ -248,8 +248,8 @@ func (h *LocalHandler) handleInvoke(ctx context.Context, data []byte) ([]byte, e
248248 trace .WithAttributes (
249249 attribute .String ("function.id" , functionID ),
250250 attribute .String ("agent.id" , h .agentID ),
251- attribute .String ("service.id" , req .GetMetadata ()["service_id " ]),
252- attribute .String ("task.id" , req .GetMetadata ()["task_id " ]),
251+ attribute .String ("service.id" , req .GetMetadata ()["serviceId " ]),
252+ attribute .String ("task.id" , req .GetMetadata ()["taskId " ]),
253253 ),
254254 )
255255 defer span .End ()
@@ -307,7 +307,7 @@ func (h *LocalHandler) callProvider(ctx context.Context, functionID string, meta
307307 sessions := h .providerSessions
308308 h .mu .RUnlock ()
309309 if sessions != nil {
310- serviceID := metadata ["service_id " ]
310+ serviceID := metadata ["serviceId " ]
311311 if serviceID != "" {
312312 if session , ok := sessions .GetByServiceID (serviceID ); ok && session .Conn () != nil {
313313 _ , response , err := session .Conn ().Call (ctx , msgID , data )
@@ -385,7 +385,7 @@ func (h *LocalHandler) pickInstance(functionID string, metadata map[string]strin
385385 }
386386
387387 // 按 service_id 路由(一级过滤)
388- targetService := metadata ["service_id " ]
388+ targetService := metadata ["serviceId " ]
389389 var arr []agentlocal.Instance
390390 if targetService != "" {
391391 arr = serviceMap [targetService ]
@@ -462,7 +462,7 @@ func (h *LocalHandler) executeTask(ctx context.Context, req *sdkv1.InvokeRequest
462462 trace .WithAttributes (
463463 attribute .String ("function.id" , req .GetFunctionId ()),
464464 attribute .String ("agent.id" , h .agentID ),
465- attribute .String ("task.id" , req .GetMetadata ()["task_id " ]),
465+ attribute .String ("task.id" , req .GetMetadata ()["taskId " ]),
466466 ),
467467 )
468468 defer span .End ()
@@ -818,11 +818,11 @@ func (h *LocalHandler) handleProviderConnect(ctx context.Context, data []byte) (
818818 }
819819 // 提取元数据(参考 Nacos metadata)
820820 metadata := map [string ]string {
821- "sdk_language" : req .SdkLanguage ,
822- "sdk_version" : req .SdkVersion ,
823- "sdk_name" : req .SdkName ,
821+ "sdkLanguage" : req .SdkLanguage ,
822+ "sdkVersion" : req .SdkVersion ,
823+ "sdkName" : req .SdkName ,
824824 "protocol_version" : req .ProtocolVersion ,
825- "game_id" : req .GameId ,
825+ "gameId" : req .GameId ,
826826 "env" : req .Env ,
827827 }
828828 // Use empty addr here; the TCP onConnect path sets the real address.
0 commit comments