feat: Improve execute terminal command tool

This commit is contained in:
Petr Mironychev
2026-03-13 00:34:20 +01:00
parent 6910037e97
commit 37084bec59
5 changed files with 93 additions and 86 deletions

View File

@ -46,12 +46,12 @@ private:
QString getCommandDescription() const;
QString sanitizeOutput(const QString &output, qint64 maxSize) const;
int commandTimeoutMs() const;
// Constants for production safety
static constexpr int COMMAND_TIMEOUT_MS = 30000; // 30 seconds
static constexpr qint64 MAX_OUTPUT_SIZE = 10 * 1024 * 1024; // 10 MB
static constexpr int MAX_COMMAND_LENGTH = 1024;
static constexpr int MAX_ARGS_LENGTH = 4096;
static constexpr int PROCESS_START_TIMEOUT_MS = 3000;
};
} // namespace QodeAssist::Tools