
ArkOpsAi
Intelligent Server Management Assistant
Список изменений
Issues Fixed:
-
Tool Call Parameter Lack of Validation — Added safe extraction methods
requireString(),optionalString(), andoptionalInt(), replacing all direct calls toargs.get().getAsString()to avoid NPE (Non-Point Exception). -
Redundant Handler Instances — Instead of creating separate
OpsCommandExecutorandOpsGuiCommandinstances, they now receive shared instances to ensure frequency limits and context sharing. -
ArrayList Thread Safety — Changed the value type of
requestTimestampsfromArrayListtoCopyOnWriteArrayList, and added synchronized protection tocheckRateLimit. -
Prompt Injection Protection — Added NFKC normalization, character filtering control, a 2000-character length limit, and 20+ injection variant matching rules to
sanitizeInput(). -
Incomplete Context Saving — Rewrote
saveContext()to save the complete conversation context (user message + all tool_calls/tool results), using a Java List as an intermediary to resolve JsonArray issues. Issues with unsupported index insertion: -
Tab completion logic defect — onTabComplete() now uses String.join(" ", args) to match multi-word prefixes, correctly handling multi-word subcommands such as "set gamemode".
-
Unused configuration values — max-tokens and temperature are now read from config.yml instead of being hardcoded.
-
OkHttpClient timeout not read — connectTimeout / readTimeout / writeTimeout are now read from the timeout value in the configuration.
-
check_permission information leakage — check_permission tool moved to the SUPER_ADMIN permission block, inaccessible to ordinary users; reload_* series tools are also moved to the SUPER_ADMIN block.
-
JarFile resource leakage — JarFile and ClassLoader in the loadSkillsFromFolder, reloadSkill, and loadNewSkills methods are all changed to try-with-resources.
-
Notice board not restored — PlayerQuitEvent added. 11. Listener for clearing SignSession in sessions and restoring signboard blocks to empty when a player exits:
-
Storage Leakage: Added the
cleanupPlayerData(UUID)method to clearplayerContextsandrequestTimestamps, called inChatListener'sPlayerQuitEvent. -
Uninterpreted Help Information: All help text is now read using
lang.getMessage("command.help_*"), and corresponding translation keys have been added tozh.ymlanden.yml. -
CompletableFuture using ForkJoinPool: Added a custom
ExecutorService(daemon thread, thread nameArkOpsAI-Async), all asynchronous requests now use the custom thread pool, and it is correctly shut down inshutdown(). -
Added User Agreement and Privacy Policy
