Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions scripts/generate-openclaw-config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -957,10 +957,18 @@ export function buildConfig(env: Env = process.env): JsonObject {
tools.web.fetch = { enabled: true, useTrustedEnvProxy: true };

if (env.NEMOCLAW_WEB_SEARCH_ENABLED === "1") {
tools.web.search = {
// OpenClaw 2026.5.x: web-search providers are external plugins. The
// provider-owned apiKey lives under plugins.entries.<plugin>.config,
// not inline in tools.web.search. Writing the legacy inline shape makes
// the build-time `openclaw plugins install` exit non-zero during its
// pre-install config validation (the brave plugin is not installed yet),
// aborting the image build under `set -eu` before `doctor --fix` can
// migrate it. Emit the current schema directly so install validates
// cleanly. See NemoClaw #5266 (follow-up to #4955 / #3948).
tools.web.search = { enabled: true, provider: "brave" };
config.plugins.entries.brave = {
enabled: true,
provider: "brave",
apiKey: "openshell:resolve:env:BRAVE_API_KEY",
config: { webSearch: { apiKey: "openshell:resolve:env:BRAVE_API_KEY" } },
};
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Expand Down
12 changes: 10 additions & 2 deletions test/generate-openclaw-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,13 +796,21 @@ describe("generate-openclaw-config.mts: config generation", () => {
expect(config.tools?.web?.search).toBeUndefined();
});

it("enables web search when env is '1'", () => {
it("enables web search when env is '1' using the current plugin schema", () => {
const config = runConfigScript({ NEMOCLAW_WEB_SEARCH_ENABLED: "1" });
expect(config.tools?.toolSearch).toBe(true);
// Current OpenClaw schema: tools.web.search carries only enabled+provider;
// the provider-owned apiKey lives under plugins.entries.brave.config. The
// legacy inline-apiKey shape makes build-time `openclaw plugins install`
// exit non-zero on its pre-install config validation. See #5266.
expect(config.tools?.web?.search).toEqual({
enabled: true,
provider: "brave",
apiKey: "openshell:resolve:env:BRAVE_API_KEY",
});
expect(config.tools?.web?.search?.apiKey).toBeUndefined();
expect(config.plugins?.entries?.brave).toEqual({
enabled: true,
config: { webSearch: { apiKey: "openshell:resolve:env:BRAVE_API_KEY" } },
});
expect(config.tools?.web?.fetch).toEqual({
enabled: true,
Expand Down
Loading