Skip to content

Commit 6361bcc

Browse files
xueyizhengclaude
andcommitted
[docs][evaluation] fix stale doc comment & clarify retry semantics
- ValidateOpenAPIEvalTargetClusterEnv doc comment matched the pre-narrowing behavior (claimed to validate a2a/custom_rpc); correct it to reflect that only custom_agent is validated now. - record_data.go: note that the upload retry currently retries ALL errors indiscriminately (no transient/permanent distinction); suggest backoff.Permanent for non-transient errors if an error-code set is known later. Comment-only, no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 99d3b59 commit 6361bcc

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

‎backend/modules/evaluation/application/convertor/experiment/openapi.go‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,16 @@ func IsSupportedOpenAPIEvalTargetType(t openapiEvalTarget.EvalTargetType) bool {
248248
return err == nil
249249
}
250250

251-
// ValidateOpenAPIEvalTargetClusterEnv validates the required cluster/env for
252-
// long-connection eval targets (custom_agent / a2a_agent / custom_rpc_server).
253-
// These are resolved to a live RPC/frontier client at run time, so a missing
254-
// cluster/env passes creation silently and only fails later with an opaque RPC
255-
// error. Rejecting it up front yields a clear param error with common values.
256-
// - custom_agent / a2a_agent: both cluster and env are caller-supplied → required.
257-
// - custom_rpc_server: cluster comes from the app config, only env is required.
251+
// ValidateOpenAPIEvalTargetClusterEnv validates the required cluster/env for the
252+
// long-connection custom_agent eval target. custom_agent is resolved to a live
253+
// RPC/frontier client at run time, so a missing cluster/env passes creation
254+
// silently and only fails later with an opaque RPC error; rejecting it up front
255+
// yields a clear param error with common values.
256+
// - custom_agent: cluster and env are required, UNLESS an explicit AgentConnection
257+
// (frontier direct-connect) is provided — direct-connect does not use cluster/env.
258+
// - a2a_agent / custom_rpc_server: intentionally NOT validated for now.
258259
//
259-
// Returns nil when param/type is nil or the type is not a long-connection target.
260+
// Returns nil when param/type is nil or the type is not custom_agent.
260261
func ValidateOpenAPIEvalTargetClusterEnv(param *openapi.SubmitExperimentEvalTargetParam) error {
261262
if param == nil || param.EvalTargetType == nil {
262263
return nil

‎backend/modules/evaluation/infra/storage/record_data.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ func (s *RecordDataStorage) processContent(ctx context.Context, content *entity.
247247
key := EvalRecordFieldKeyPrefix + uuid.New().String()
248248
// ImageX/对象存储偶发单实例迁移会返回临时错误(如 201007 / bad gateway),系统会自动迁移恢复,重试即可成功。
249249
// 这里做固定间隔的止血重试:最多 2 次重试(共 3 次尝试)、间隔 1.5s;每轮都重建 reader,避免上一轮已消费导致重传空内容。
250+
// 注意:当前对所有 error 无差别重试,未区分瞬时/永久错误——权限、参数非法等确定性失败也会重试满 3 次(额外等 ~3s)后才返回。
251+
// 若后续拿到可重试错误码集合,可在闭包内对非瞬时错误用 backoff.Permanent(err) 短路。
250252
data := []byte(text)
251253
if err := backoff.RetryWithMaxTimesAndInterval(ctx, 2, 1500*time.Millisecond, func() error {
252254
return s.batchStorage.Upload(ctx, key, bytes.NewReader(data))

0 commit comments

Comments
 (0)