chore: format llm c files
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 9s
JS/TS / lint (pull_request) Successful in 9s
JS/TS / fmt (pull_request) Successful in 16s
C++ / clang-tidy (pull_request) Failing after 43s
Python / static (pull_request) Failing after 57s
Rust / fmt (pull_request) Successful in 1m30s
Rust / build (pull_request) Successful in 2m5s
Rust / clippy (pull_request) Successful in 1m55s
Python / verify (pull_request) Successful in 2m23s

This commit is contained in:
2026-08-31 19:02:26 +02:00
parent dbb51ceadd
commit 52feb6006a
27 changed files with 741 additions and 1190 deletions
-9
View File
@@ -13,11 +13,6 @@ class QTimer;
namespace ZShell::llm {
// Fetches an http(s) URL and returns its content as plain text or raw
// HTML. Read-only. Mirrors opencode's webfetch tool, without markdown
// conversion and the permission prompt. Concurrent fetches are
// supported; results are always delivered on a later event loop
// iteration, never synchronously from execute().
class WebFetchTool : public LlmTool {
Q_OBJECT
@@ -25,8 +20,6 @@ class WebFetchTool : public LlmTool {
static constexpr int MaxResponseBytes = 5 * 1024 * 1024;
static constexpr int DefaultTimeoutSeconds = 30;
static constexpr int MaxTimeoutSeconds = 120;
// Caps the characters handed to the model so a large page cannot
// blow out the context.
static constexpr int MaxOutputChars = 64 * 1024;
explicit WebFetchTool(QObject* parent = nullptr);
@@ -40,8 +33,6 @@ class WebFetchTool : public LlmTool {
std::function<void(const QJsonObject& result)> done) override;
void cancel() override;
// Strips tags (skipping script/style/noscript/iframe/object/embed/
// head) and decodes common entities.
static QString extractTextFromHtml(const QString& html);
static QString decodeEntities(const QString& text);