zeroclaw/src/tools
SimianAstronaut7 0fea62d114
fix(tool): resolve Brave API key lazily with decryption support (#3078) (#3320)
WebSearchTool previously stored the Brave API key once at boot and never
re-read it. This caused three failures: (1) keys set after boot via
web_search_config were ignored, (2) encrypted keys passed as raw enc2:
blobs to the Brave API, and (3) keys absent at startup left the tool
permanently broken.

The fix adds lazy key resolution at execution time. A fast path returns
the boot-time key when it is plaintext and non-empty. When the boot key
is missing or still encrypted, the tool re-reads config.toml, decrypts
the value through SecretStore, and uses the result. This also means
runtime config updates (e.g. `web_search_config set brave_api_key=...`)
are picked up on the next search invocation.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:53:35 +00:00
..
browser_open.rs fix(security): harden redirect/browser_open and restore masked secrets 2026-02-24 16:03:01 +08:00
browser.rs fix(tools): recover rust-native browser session on stale webdriver 2026-02-24 16:03:00 +08:00
cli_discovery.rs fix(gateway): align dashboard API client and embed built web assets 2026-02-21 16:14:01 +08:00
composio.rs fix(security): harden redirect/browser_open and restore masked secrets 2026-02-24 16:03:01 +08:00
content_search.rs fix(tool): harden content_search parsing and output safety 2026-02-21 23:26:11 +08:00
cron_add.rs fix(security): unify cron shell validation across API/CLI/scheduler (#3270) 2026-03-12 12:48:13 +00:00
cron_list.rs style: apply rustfmt to async fs updates 2026-02-19 14:52:29 +08:00
cron_remove.rs fix(security): unify cron shell validation across API/CLI/scheduler (#3270) 2026-03-12 12:48:13 +00:00
cron_run.rs fix(security): unify cron shell validation across API/CLI/scheduler (#3270) 2026-03-12 12:48:13 +00:00
cron_runs.rs style: apply rustfmt to async fs updates 2026-02-19 14:52:29 +08:00
cron_update.rs fix(security): unify cron shell validation across API/CLI/scheduler (#3270) 2026-03-12 12:48:13 +00:00
delegate.rs fix(provider): preserve reasoning_content in tool-call conversation history 2026-02-22 17:40:48 +08:00
file_edit.rs fix: improve allowed_roots guidance for filesystem access 2026-02-21 17:33:11 +08:00
file_read.rs test(file_read): align outside-workspace case with workspace_only=false policy 2026-02-24 16:03:01 +08:00
file_write.rs fix: improve allowed_roots guidance for filesystem access 2026-02-21 17:33:11 +08:00
git_operations.rs feat(channel): stream LLM responses to Telegram via draft message edits 2026-02-18 16:33:33 +08:00
glob_search.rs feat(tool): add glob_search for workspace file pattern search 2026-02-21 02:27:54 +08:00
hardware_board_info.rs fix: resolve all clippy warnings, formatting, and Mistral endpoint 2026-02-17 20:00:08 +08:00
hardware_memory_map.rs fix: resolve all clippy warnings, formatting, and Mistral endpoint 2026-02-17 20:00:08 +08:00
hardware_memory_read.rs fix(security): resolve rebase conflicts and provider regressions 2026-02-17 19:19:06 +08:00
http_request.rs fix(tool): treat max_response_size = 0 as unlimited 2026-02-24 16:03:00 +08:00
image_info.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
memory_forget.rs fix(policy): standardize side-effect tool autonomy gates 2026-02-18 12:42:56 +08:00
memory_recall.rs feat(memory): add session_id isolation to Memory trait (#530) 2026-02-17 07:44:05 -05:00
memory_store.rs fix(channels): recover malformed invoke/tool_call output in daemon mode 2026-02-18 17:01:36 +08:00
mod.rs fix(tool): resolve Brave API key lazily with decryption support (#3078) (#3320) 2026-03-12 13:53:35 +00:00
model_routing_config.rs feat(tools): add natural-language model routing config tool 2026-02-21 20:45:43 +08:00
pdf_read.rs fix: improve allowed_roots guidance for filesystem access 2026-02-21 17:33:11 +08:00
proxy_config.rs feat: add multimodal image marker support with Ollama vision 2026-02-19 21:25:21 +08:00
pushover.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
schedule.rs fix(security): unify cron shell validation across API/CLI/scheduler (#3270) 2026-03-12 12:48:13 +00:00
schema.rs fix(build): complete strict lint and test cleanup (replacement for #476) 2026-02-18 00:18:54 +08:00
screenshot.rs Addressed clippy lint issues 2026-03-10 01:48:19 -04:00
shell.rs Addressed clippy lint issues 2026-03-10 01:48:19 -04:00
sop_advance.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_approve.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_execute.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_list.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_status.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
traits.rs test: deepen and complete project-wide test coverage (#297) 2026-02-16 05:58:24 -05:00
web_fetch.rs Harden config secret masking and web_fetch limits 2026-02-24 16:03:01 +08:00
web_search_tool.rs fix(tool): resolve Brave API key lazily with decryption support (#3078) (#3320) 2026-03-12 13:53:35 +00:00