Skip to content

gateway: silent-fallback hardening in crates/zeroclaw-gateway/src/lib.rs (follow-up to #6099)Β #6127

Description

@perlowja

Tracking issue per @WareWolf-MoonWall's merge-condition on #6099.

What's still silent after #6099

#6099 (`fix(config): preserve user-supplied providers.fallback through load/save`) hardens the runtime-side credential resolution with the fail-loud / sentinel split β€” but the gateway-side resolution path in `crates/zeroclaw-gateway/src/lib.rs` still falls back silently when a profile-resolved credential is unavailable. Same problem space as the runtime fix; different surface.

This is the merge-condition WareWolf-MoonWall flagged on #6099: gateway-side hardening must be tracked before the runtime-side fix lands so the asymmetric remediation isn't forgotten.

Fix shape

Mirror the runtime-side pattern from #6099:

  1. Fail-loud: when a fallback provider is requested but no profile-resolved credentials exist, return a structured error to the gateway caller rather than silently using an empty/sentinel credential.
  2. Sentinel split: distinguish "no credential intentionally" (gateway runs anonymously by design) from "credential resolution failed" (operator misconfiguration).
  3. Operator-actionable error: include the provider name, the resolved profile, and the credential field that failed to resolve.

Scope

  • File: `crates/zeroclaw-gateway/src/lib.rs` β€” the credential resolution call sites adjacent to `fallback_providers` lookup.
  • Channels-side similar paths can travel with this PR (per @WareWolf-MoonWall's "channels sites can travel with it" note).

Cross-references

cc @WareWolf-MoonWall @singlerider β€” opening this so #6099 can merge cleanly.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgatewayAuto scope: src/gateway/** changed.priority:p2Medium prioritysecurityAuto scope: src/security/** changed.status:acceptedAccepted RFC/work item; not stale-exempt by itself.status:no-staleExempt from 60-day stale auto-close only with public reason and revisit surface.

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions