"ShameGPT" updated: Error Handling

Current Features and Changes 🔗

Robust Configuration Validation: The mod checks if model_name is empty or consists only of whitespace, automatically defaulting to gemma3:270m in those cases.

Asynchronous Processing: It uses a globalstep monitor and system-level background execution (&) to prevent the Minetest server from freezing while the AI generates a response.

ANSI Escape Sequence Cleaning: A clean_ai_text function is implemented to strip terminal formatting codes, carriage returns, and leading/trailing whitespace from the AI's output.

Security Prompt Filtering: The is_safe_prompt function uses pattern matching to block dangerous characters (like ;, &, |, and $) that could be used for command injection.

Binary Presence Check: The mod utilizes the command_exists function to verify if the ollama executable is available on the system before attempting a request.

Request Concurrency Management: An active_requests table tracks ongoing queries per player to prevent users from spamming the AI service.

Automated Cleanup: Once a response is read, the mod automatically deletes the temporary result and "done" signal files from the system.

System Limitations 🔗

[!IMPORTANT] Linux Only: The current implementation relies on Unix-specific commands and shell operators such as which, touch, 2>/dev/null, and the background operator &. Consequently, it only works on Linux. Language: All user-facing messages, command descriptions, and error notifications are currently written only in English.