refactor: remove retryEnabled from tool metadata

This commit is contained in:
jade
2026-08-31 10:12:31 +09:00
parent 14cb280b0e
commit 2809f1fd3a
7 changed files with 3 additions and 24 deletions

View File

@@ -137,7 +137,6 @@ public class ScaffoldingController {
parseDelimited(req.get("tags")), parseDelimited(req.get("tags")),
req.get("ownerOrg"), req.get("ownerOrg"),
positiveLongOrNull(req.get("timeoutMillis")), positiveLongOrNull(req.get("timeoutMillis")),
req.containsKey("retryEnabled") ? Boolean.valueOf(req.get("retryEnabled")) : null,
positiveIntOrNull(req.get("retryMaxAttempts"))); positiveIntOrNull(req.get("retryMaxAttempts")));
String defaultWorkspace = DEFAULT_WORKSPACE; String defaultWorkspace = DEFAULT_WORKSPACE;

View File

@@ -353,7 +353,7 @@ public class ExecuteService {
private boolean retryAllowedByOperation(ToolMetadata metadata, ObjectNode arguments) { private boolean retryAllowedByOperation(ToolMetadata metadata, ObjectNode arguments) {
if (metadata.getOperationType() == OperationType.READ) { if (metadata.getOperationType() == OperationType.READ) {
return metadata.getRetryEnabled() != null ? metadata.getRetryEnabled() : true; return true;
} }
return arguments.hasNonNull("idempotencyKey") && !arguments.path("idempotencyKey").asText("").isBlank(); return arguments.hasNonNull("idempotencyKey") && !arguments.path("idempotencyKey").asText("").isBlank();
} }

View File

@@ -1037,13 +1037,6 @@
<input type="number" class="form-control" name="timeoutMillis" value="5000" min="1" step="1"> <input type="number" class="form-control" name="timeoutMillis" value="5000" min="1" step="1">
<div class="input-hint">Tool 호출 최대 대기 시간입니다.</div> <div class="input-hint">Tool 호출 최대 대기 시간입니다.</div>
</div> </div>
<div class="col-md-4">
<label class="form-label">Retry Enabled</label>
<select class="form-select" name="retryEnabled">
<option value="true" selected>true</option>
<option value="false">false</option>
</select>
</div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label">Retry Max Attempts</label> <label class="form-label">Retry Max Attempts</label>
<input type="number" class="form-control" name="retryMaxAttempts" value="3" min="1" step="1"> <input type="number" class="form-control" name="retryMaxAttempts" value="3" min="1" step="1">
@@ -1681,7 +1674,6 @@
exampleQueries: (data.exampleQueries || '').split(/[\n,]+/).map(value => value.trim()).filter(Boolean), exampleQueries: (data.exampleQueries || '').split(/[\n,]+/).map(value => value.trim()).filter(Boolean),
tags: (data.tags || '').split(',').map(value => value.trim()).filter(Boolean), ownerOrg: data.ownerOrg || 'MCP_TOOL', tags: (data.tags || '').split(',').map(value => value.trim()).filter(Boolean), ownerOrg: data.ownerOrg || 'MCP_TOOL',
timeoutMillis: Number(data.timeoutMillis || 5000), timeoutMillis: Number(data.timeoutMillis || 5000),
retryEnabled: data.retryEnabled !== 'false',
retryMaxAttempts: Number(data.retryMaxAttempts || 3) retryMaxAttempts: Number(data.retryMaxAttempts || 3)
} }
}; };

View File

@@ -30,7 +30,6 @@ public @interface GrowToolHint {
String inputSchemaResource() default ""; String inputSchemaResource() default "";
String outputSchemaResource() default ""; String outputSchemaResource() default "";
long timeoutMillis() default 5000L; long timeoutMillis() default 5000L;
boolean retryEnabled() default true;
int retryMaxAttempts() default 3; int retryMaxAttempts() default 3;
// Meta 정보 추가 (보고용 샘플) // Meta 정보 추가 (보고용 샘플)

View File

@@ -70,24 +70,19 @@ public class ToolScaffolder {
List<String> tags, List<String> tags,
String ownerOrg, String ownerOrg,
Long timeoutMillis, Long timeoutMillis,
Boolean retryEnabled,
Integer retryMaxAttempts) { Integer retryMaxAttempts) {
public ToolDefinitionOptions(String functionDescription, String whenToUse, String whenNotToUse, public ToolDefinitionOptions(String functionDescription, String whenToUse, String whenNotToUse,
String ioLimits, String displayDescription, List<String> exampleQueries, String ioLimits, String displayDescription, List<String> exampleQueries,
List<String> tags, String ownerOrg) { List<String> tags, String ownerOrg) {
this(functionDescription, whenToUse, whenNotToUse, ioLimits, displayDescription, exampleQueries, tags, this(functionDescription, whenToUse, whenNotToUse, ioLimits, displayDescription, exampleQueries, tags,
ownerOrg, null, null, null); ownerOrg, null, null);
} }
public long timeoutMillisOrDefault() { public long timeoutMillisOrDefault() {
return timeoutMillis != null && timeoutMillis > 0 ? timeoutMillis : 5000L; return timeoutMillis != null && timeoutMillis > 0 ? timeoutMillis : 5000L;
} }
public boolean retryEnabledOrDefault() {
return retryEnabled == null || retryEnabled;
}
public int retryMaxAttemptsOrDefault() { public int retryMaxAttemptsOrDefault() {
return retryMaxAttempts != null && retryMaxAttempts > 0 ? retryMaxAttempts : 3; return retryMaxAttempts != null && retryMaxAttempts > 0 ? retryMaxAttempts : 3;
} }
@@ -265,7 +260,6 @@ public class ToolScaffolder {
.append(" requiresApproval = ").append(isMutation).append(",\n") .append(" requiresApproval = ").append(isMutation).append(",\n")
.append(" categoryKey = \"").append(tool.group().toLowerCase(Locale.ROOT)).append("\",\n") .append(" categoryKey = \"").append(tool.group().toLowerCase(Locale.ROOT)).append("\",\n")
.append(" timeoutMillis = ").append(opts.timeoutMillisOrDefault()).append("L,\n") .append(" timeoutMillis = ").append(opts.timeoutMillisOrDefault()).append("L,\n")
.append(" retryEnabled = ").append(opts.retryEnabledOrDefault()).append(",\n")
.append(" retryMaxAttempts = ").append(opts.retryMaxAttemptsOrDefault()).append(",\n"); .append(" retryMaxAttempts = ").append(opts.retryMaxAttemptsOrDefault()).append(",\n");
if (tool.interfaceId() != null && !tool.interfaceId().isBlank()) { if (tool.interfaceId() != null && !tool.interfaceId().isBlank()) {
methods.append(" mappingId = \"").append(javaText(tool.interfaceId())).append("\",\n"); methods.append(" mappingId = \"").append(javaText(tool.interfaceId())).append("\",\n");
@@ -424,7 +418,6 @@ public class ToolScaffolder {
.append(" requiresApproval = ").append(isMutation).append(",\n") .append(" requiresApproval = ").append(isMutation).append(",\n")
.append(" categoryKey = \"").append(tool.group().toLowerCase(Locale.ROOT)).append("\",\n") .append(" categoryKey = \"").append(tool.group().toLowerCase(Locale.ROOT)).append("\",\n")
.append(" timeoutMillis = ").append(opts.timeoutMillisOrDefault()).append("L,\n") .append(" timeoutMillis = ").append(opts.timeoutMillisOrDefault()).append("L,\n")
.append(" retryEnabled = ").append(opts.retryEnabledOrDefault()).append(",\n")
.append(" retryMaxAttempts = ").append(opts.retryMaxAttemptsOrDefault()).append(",\n"); .append(" retryMaxAttempts = ").append(opts.retryMaxAttemptsOrDefault()).append(",\n");
String mappingId = option(tool.interfaceId(), tool.httpApiName()); String mappingId = option(tool.interfaceId(), tool.httpApiName());
if (mappingId != null && !mappingId.isBlank()) { if (mappingId != null && !mappingId.isBlank()) {
@@ -813,7 +806,6 @@ public class ToolScaffolder {
sb.append(" requiresApproval = ").append(isMutation).append(",\n"); sb.append(" requiresApproval = ").append(isMutation).append(",\n");
sb.append(" categoryKey = \"").append(group.toLowerCase(Locale.ROOT)).append("\",\n"); sb.append(" categoryKey = \"").append(group.toLowerCase(Locale.ROOT)).append("\",\n");
sb.append(" timeoutMillis = ").append(definitionOptions.timeoutMillisOrDefault()).append("L,\n"); sb.append(" timeoutMillis = ").append(definitionOptions.timeoutMillisOrDefault()).append("L,\n");
sb.append(" retryEnabled = ").append(definitionOptions.retryEnabledOrDefault()).append(",\n");
sb.append(" retryMaxAttempts = ").append(definitionOptions.retryMaxAttemptsOrDefault()).append(",\n"); sb.append(" retryMaxAttempts = ").append(definitionOptions.retryMaxAttemptsOrDefault()).append(",\n");
if (interfaceId != null && !interfaceId.isBlank()) { if (interfaceId != null && !interfaceId.isBlank()) {
sb.append(" mappingId = \"").append(interfaceId).append("\",\n"); sb.append(" mappingId = \"").append(interfaceId).append("\",\n");

View File

@@ -121,8 +121,6 @@ public class ToolMetadata {
@Builder.Default @Builder.Default
private OperationType operationType = OperationType.READ; private OperationType operationType = OperationType.READ;
@Builder.Default
private Boolean retryEnabled = true;
@Builder.Default @Builder.Default
private Integer retryMaxAttempts = 3; private Integer retryMaxAttempts = 3;

View File

@@ -472,7 +472,7 @@ class ToolScaffolderTest {
ToolScaffolder.scaffoldUseCase("Customer", moduleName, "tester", "2026.08.13", List.of( ToolScaffolder.scaffoldUseCase("Customer", moduleName, "tester", "2026.08.13", List.of(
new ToolScaffolder.ToolMethodDefinition("CustomerProfile", "getProfile", "CUST001", "Profile", "profile", "cmm", "MCI", new ToolScaffolder.ToolMethodDefinition("CustomerProfile", "getProfile", "CUST001", "Profile", "profile", "cmm", "MCI",
false, "CSTM", null, List.of(), List.of(), new ToolScaffolder.ToolDefinitionOptions( false, "CSTM", null, List.of(), List.of(), new ToolScaffolder.ToolDefinitionOptions(
null, null, null, null, null, List.of(), List.of(), null, 12000L, false, 5)))); null, null, null, null, null, List.of(), List.of(), null, 12000L, 5))));
ToolScaffolder.scaffoldUseCase("Customer", moduleName, "tester", "2026.08.13", List.of( ToolScaffolder.scaffoldUseCase("Customer", moduleName, "tester", "2026.08.13", List.of(
new ToolScaffolder.ToolMethodDefinition("CustomerNotice", "getNotice", "NOTICE001", "Notice", "notice", "cmm", "HTTP", new ToolScaffolder.ToolMethodDefinition("CustomerNotice", "getNotice", "NOTICE001", "Notice", "notice", "cmm", "HTTP",
false, null, "customer-notice", List.of(), List.of(), null))); false, null, "customer-notice", List.of(), List.of(), null)));
@@ -482,7 +482,6 @@ class ToolScaffolderTest {
String impl = Files.readString(sourceRoot.resolve("biz/cmm/usecase/impl/CustomerUseCaseImpl.java")); String impl = Files.readString(sourceRoot.resolve("biz/cmm/usecase/impl/CustomerUseCaseImpl.java"));
assertTrue(useCase.contains("getProfile(CustomerProfileRequest req)"), useCase); assertTrue(useCase.contains("getProfile(CustomerProfileRequest req)"), useCase);
assertTrue(useCase.contains("timeoutMillis = 12000L"), useCase); assertTrue(useCase.contains("timeoutMillis = 12000L"), useCase);
assertTrue(useCase.contains("retryEnabled = false"), useCase);
assertTrue(useCase.contains("retryMaxAttempts = 5"), useCase); assertTrue(useCase.contains("retryMaxAttempts = 5"), useCase);
assertTrue(useCase.contains("getNotice(CustomerNoticeRequest req)"), useCase); assertTrue(useCase.contains("getNotice(CustomerNoticeRequest req)"), useCase);
assertTrue(impl.contains("private final MciCstmClient mciCstmClient;"), impl); assertTrue(impl.contains("private final MciCstmClient mciCstmClient;"), impl);