Skip to content

fix(secrets): keep gateway alive when web provider refs fail#109687

Merged
steipete merged 3 commits into
mainfrom
fix/secretref-web-owner-isolation
Jul 17, 2026
Merged

fix(secrets): keep gateway alive when web provider refs fail#109687
steipete merged 3 commits into
mainfrom
fix/secretref-web-owner-isolation

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #108485
Related: #101265

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Fixes an issue where Gateway startup failed, or silently used provider environment credentials, when an explicitly configured active web-search or web-fetch SecretRef could not resolve.

Why This Change Was Made

Cold startup now isolates only the explicitly configured web provider as a degraded capability. The Gateway starts, unrelated providers remain available, and calls to the isolated provider return the canonical typed unavailable error. Strict reload and command resolution remain fail-closed. The legacy environment fallback after a failed explicit ref is removed; ordinary environment auto-detection remains unchanged.

AI-assisted implementation. I reviewed the owner boundary, runtime callers, command callers, web-tool execution paths, sibling search/fetch behavior, startup activation, tests, and current SecretRef degradation contract.

User Impact

Operators can start the Gateway when one web provider credential ref is temporarily broken. Only that exact provider stays cold, with degraded-owner visibility, instead of blocking the whole Gateway or silently switching credential sources.

Evidence

  • Autoreview: clean, no accepted/actionable findings (confidence 0.91).
  • Focused Testbox proof: 59 tests passed across Gateway startup, web SecretRef resolution, and typed web-search/web-fetch unavailability.
  • Full Testbox changed gate: green in 19m10s, including format, Plugin SDK baseline, production and test typechecks, all core lint shards, plugin boundaries, database-first guards, runtime import cycles, and webhook/pairing guards.
  • Testbox run: https://github.com/openclaw/openclaw/actions/runs/29557117928
  • Final rebase preserved the exact patch (git patch-id --stable: 69fc3d30ad67e44d56fe0b8df2cc6d6d2792e4e9).
  • After the final rebase, the Plugin SDK baseline mismatch reproduces on clean latest origin/main; generated branch and main baseline JSON/JSONL are byte-for-byte identical. No SDK surface change comes from this patch.

@steipete
steipete requested a review from a team as a code owner July 17, 2026 05:46
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Jul 17, 2026
@steipete
steipete force-pushed the fix/secretref-web-owner-isolation branch from 4b9ee41 to 68f222d Compare July 17, 2026 05:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b9ee410e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/secrets/runtime-web-tools.shared.ts
@steipete
steipete force-pushed the fix/secretref-web-owner-isolation branch from 68f222d to d4354a0 Compare July 17, 2026 05:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4354a0d71

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/secrets/runtime-web-tools.shared.ts
@steipete
steipete force-pushed the fix/secretref-web-owner-isolation branch from d4354a0 to 185238c Compare July 17, 2026 06:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 185238c07e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

if (selectedProvider) {
if (selectedProvider && !unavailableProvider) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark isolated search providers unusable

Fresh evidence: this tree now suppresses selectedProvider, but when an explicit web_search provider is isolated this branch leaves providerSource: "configured" and providerConfigured in the metadata. hasUsableWebSearchProvider only checks selectedProvider before falling through to resolveWebSearchCandidates, and that path treats providerConfigured as a runtime-preferred explicit provider (src/web-search/runtime.ts:215-230,410-416), so cron/tools-allow preflight (src/cron/isolated-agent/run.ts:399-414) still reports web_search usable even though execution will immediately throw SECRET_SURFACE_UNAVAILABLE for that provider.

Useful? React with 👍 / 👎.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for head 185238c:

Pure bug fix. No UI, config, environment, or feature surface change.

@steipete
steipete merged commit 0097363 into main Jul 17, 2026
189 of 194 checks passed
@steipete
steipete deleted the fix/secretref-web-owner-isolation branch July 17, 2026 06:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…w#109687)

* fix(secrets): isolate unavailable web providers

* fix(secrets): keep web result type internal

* fix(secrets): hide unavailable web selections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant