Improve execute_commands response schema and diagnostics#4
Improve execute_commands response schema and diagnostics#4
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94a4504d6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| CommandOutcomeAnalyzer.Outcome outcome = | ||
| CommandOutcomeAnalyzer.analyze(true, chatMessages, result.getSummary()); |
There was a problem hiding this comment.
Filter non-command chat before classifying command outcomes
applyOutcomeAnalysis derives status/applied from the raw chatMessages list, but that list is fed by ChatMessageCapture (via ChatHud.addMessage) and therefore includes unrelated player/server chat. On multiplayer or noisy servers, an unrelated message containing markers like "cannot" or "successfully" can misclassify a command as rejected_by_game or applied, which breaks the new per-command diagnostics and any automation consuming them.
Useful? React with 👍 / 👎.
|
|
||
| private CommandResult executeCommandWithTimeout(String command) { | ||
| try { | ||
| return executeOneCommand(command).get(config.getServer().getRequestTimeoutMs(), TimeUnit.MILLISECONDS); |
There was a problem hiding this comment.
Cancel timed-out command execution before continuing sequence
The timeout path returns a synthetic timed_out result but never cancels the underlying CompletableFuture; executeOneCommand can still run later and call sendChatCommand. When requestTimeoutMs is low or the client thread is stalled, the loop proceeds to subsequent commands while the timed-out command may execute afterward, violating the documented sequential behavior and making the reported status diverge from actual world changes.
Useful? React with 👍 / 👎.
…-response-improvements # Conflicts: # src/client/java/cuspymd/mcp/mod/command/CommandExecutor.java # src/main/java/cuspymd/mcp/mod/server/MCPProtocol.java # src/test/java/cuspymd/mcp/mod/server/MCPProtocolTest.java
Improves execute_commands response schema and diagnostics, including per-command status fields, safety rejection per-command results, and related tests/docs.