refactor: remove retryEnabled from tool metadata
This commit is contained in:
@@ -30,7 +30,6 @@ public @interface GrowToolHint {
|
||||
String inputSchemaResource() default "";
|
||||
String outputSchemaResource() default "";
|
||||
long timeoutMillis() default 5000L;
|
||||
boolean retryEnabled() default true;
|
||||
int retryMaxAttempts() default 3;
|
||||
|
||||
// Meta 정보 추가 (보고용 샘플)
|
||||
|
||||
@@ -70,24 +70,19 @@ public class ToolScaffolder {
|
||||
List<String> tags,
|
||||
String ownerOrg,
|
||||
Long timeoutMillis,
|
||||
Boolean retryEnabled,
|
||||
Integer retryMaxAttempts) {
|
||||
|
||||
public ToolDefinitionOptions(String functionDescription, String whenToUse, String whenNotToUse,
|
||||
String ioLimits, String displayDescription, List<String> exampleQueries,
|
||||
List<String> tags, String ownerOrg) {
|
||||
this(functionDescription, whenToUse, whenNotToUse, ioLimits, displayDescription, exampleQueries, tags,
|
||||
ownerOrg, null, null, null);
|
||||
ownerOrg, null, null);
|
||||
}
|
||||
|
||||
public long timeoutMillisOrDefault() {
|
||||
return timeoutMillis != null && timeoutMillis > 0 ? timeoutMillis : 5000L;
|
||||
}
|
||||
|
||||
public boolean retryEnabledOrDefault() {
|
||||
return retryEnabled == null || retryEnabled;
|
||||
}
|
||||
|
||||
public int retryMaxAttemptsOrDefault() {
|
||||
return retryMaxAttempts != null && retryMaxAttempts > 0 ? retryMaxAttempts : 3;
|
||||
}
|
||||
@@ -265,7 +260,6 @@ public class ToolScaffolder {
|
||||
.append(" requiresApproval = ").append(isMutation).append(",\n")
|
||||
.append(" categoryKey = \"").append(tool.group().toLowerCase(Locale.ROOT)).append("\",\n")
|
||||
.append(" timeoutMillis = ").append(opts.timeoutMillisOrDefault()).append("L,\n")
|
||||
.append(" retryEnabled = ").append(opts.retryEnabledOrDefault()).append(",\n")
|
||||
.append(" retryMaxAttempts = ").append(opts.retryMaxAttemptsOrDefault()).append(",\n");
|
||||
if (tool.interfaceId() != null && !tool.interfaceId().isBlank()) {
|
||||
methods.append(" mappingId = \"").append(javaText(tool.interfaceId())).append("\",\n");
|
||||
@@ -424,7 +418,6 @@ public class ToolScaffolder {
|
||||
.append(" requiresApproval = ").append(isMutation).append(",\n")
|
||||
.append(" categoryKey = \"").append(tool.group().toLowerCase(Locale.ROOT)).append("\",\n")
|
||||
.append(" timeoutMillis = ").append(opts.timeoutMillisOrDefault()).append("L,\n")
|
||||
.append(" retryEnabled = ").append(opts.retryEnabledOrDefault()).append(",\n")
|
||||
.append(" retryMaxAttempts = ").append(opts.retryMaxAttemptsOrDefault()).append(",\n");
|
||||
String mappingId = option(tool.interfaceId(), tool.httpApiName());
|
||||
if (mappingId != null && !mappingId.isBlank()) {
|
||||
@@ -813,7 +806,6 @@ public class ToolScaffolder {
|
||||
sb.append(" requiresApproval = ").append(isMutation).append(",\n");
|
||||
sb.append(" categoryKey = \"").append(group.toLowerCase(Locale.ROOT)).append("\",\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");
|
||||
if (interfaceId != null && !interfaceId.isBlank()) {
|
||||
sb.append(" mappingId = \"").append(interfaceId).append("\",\n");
|
||||
|
||||
@@ -121,8 +121,6 @@ public class ToolMetadata {
|
||||
@Builder.Default
|
||||
private OperationType operationType = OperationType.READ;
|
||||
|
||||
@Builder.Default
|
||||
private Boolean retryEnabled = true;
|
||||
@Builder.Default
|
||||
private Integer retryMaxAttempts = 3;
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ class ToolScaffolderTest {
|
||||
ToolScaffolder.scaffoldUseCase("Customer", moduleName, "tester", "2026.08.13", List.of(
|
||||
new ToolScaffolder.ToolMethodDefinition("CustomerProfile", "getProfile", "CUST001", "Profile", "profile", "cmm", "MCI",
|
||||
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(
|
||||
new ToolScaffolder.ToolMethodDefinition("CustomerNotice", "getNotice", "NOTICE001", "Notice", "notice", "cmm", "HTTP",
|
||||
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"));
|
||||
assertTrue(useCase.contains("getProfile(CustomerProfileRequest req)"), useCase);
|
||||
assertTrue(useCase.contains("timeoutMillis = 12000L"), useCase);
|
||||
assertTrue(useCase.contains("retryEnabled = false"), useCase);
|
||||
assertTrue(useCase.contains("retryMaxAttempts = 5"), useCase);
|
||||
assertTrue(useCase.contains("getNotice(CustomerNoticeRequest req)"), useCase);
|
||||
assertTrue(impl.contains("private final MciCstmClient mciCstmClient;"), impl);
|
||||
|
||||
Reference in New Issue
Block a user