Add conditional S3 log offload and extend retention to 100 years in gateway - #1663
Open
gonzaloaune wants to merge 38 commits into
Open
gonzaloaune wants to merge 38 commits into
gonzaloaune wants to merge 38 commits into
Conversation
…ion to 100 years in gateway
gonzaloaune
requested review from
Evanfeenstra and
fayekelmith
as code owners
September 7, 2026 19:59
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…to fix Hash Sum mismatch in CI
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…dels (#1673) Providers are now anthropic / openai / openrouter / xai. Gemini is dropped from the seed config, compose env, plan docs, and the mcp/docs/gateway seed copy; xai reads env.XAI_API_KEY. Pricing: the accumulator looked up the bare wire model only, but bifrost's datasheet keys xAI and OpenRouter rows as "<provider>/<model>" ("xai/grok-4.3", "openrouter/moonshotai/…"), so every Grok and OpenRouter call accumulated at $0 while logs.db priced it. pricing.Keys now yields bare → provider-prefixed → prefix-stripped candidates, shared by the catalog and the operator model_pricing table; the posthook passes RoutingInfo.Provider (falling back to the deprecated ExtraFields.Provider). Also: xai entry in the canvas provider table + a stand-in glyph, an xai call in smoke-test.sh, and Makefile BIFROST_VERSION / GO_VERSION pins brought in line with the Dockerfile (transports/v1.6.2, 1.26.4) — `make docker-build` was overriding the Dockerfile default with 1.5.2. Verified live against the rebuilt image: grok-4.3 non-streaming and streaming calls under a shadow-mode macaroon accumulate 0.00025625 and 0.000285 in Redis, matching the datasheet rate to the cent.
…caroons (#1674) config.json is baked into the image and re-seeded on every boot, so the only way to move a swarm from shadow to enforce mode was a new image. The env var now overrides the plugin config block's enforce_macaroons when set (1/true/yes/on, 0/false/no/off); unset keeps the config.json value. The boot line names the winner: `auth: macaroon adapter wired enforce=<bool> source=env|config|default`. An unparseable value is deliberately not fatal. A plugin Init error does not stop bifrost-http — the wrapper waits 5s and then serves inference without the plugin, i.e. with no macaroon verification, no dim canonicalization, and /_plugin/* down, which is worse than either mode. So a typo logs at ERROR, the boot line reports source=env-invalid, and the config.json value stands. Verified live on the rebuilt image: enforce=true via env rejects a missing macaroon (401 "x-macaroon header is required") and a garbage one, and passes a valid one with mode=enforce; unset falls back to source=config; "ture" keeps the plugin active with the ERROR line.
…1.37 (#1675) Sibling of the web_search shim (#1637). Anthropic keeps its native, server-executed web_fetch tool; every other provider gets a client-executed tool of the same name and result shape backed by a guarded HTTP GET plus a dependency-free HTML-to-text pass. The HTTP path runs in our process, so every URL and every redirect hop is validated before connecting: http(s) only, no embedded credentials, localhost refused, and the host must resolve exclusively to public unicast addresses (loopback, RFC 1918, link-local incl. cloud metadata, CGNAT, ULA, NAT64/6to4 and v4-mapped v6 all refused; a mixed answer is refused). allowedDomains/blockedDomains match the host and subdomains. Bodies are capped at 4 MiB and text at maxCharacters (default 40k); maxUses is enforced in-process on the shim and passed through as max_uses to Anthropic. Failures come back to the model as a readable tool error, with undici's transport cause surfaced. getProviderTool gains "webFetch"; createWebFetch returns the same handle shape as createWebSearch (tool / backend / native / results / capture). 16 unit tests cover the guard, redirects, extraction, budgets and native-result capture; try-fetch exercises both backends.
PR #1673 added the xai entry to PROVIDER_DISPLAY / the icon table in canvasTheme.ts, but Canvas.tsx's hardcoded PROVIDERS list (which drives both the provider cards and the gateway→provider edges) was never updated, so the canvas drew no xAI card and any xai spend the matrix endpoint returned was dropped from the column. Add xai as the fifth provider, keeping gemini: the list is now deliberately a superset of the seed config's providers map so a provider absent from config.json still shows a $0 card instead of having its historical spend vanish. Refresh the stale header comment (it still said "google" and claimed per-provider spend was pending a matrix-endpoint change that already landed).
PR #1673 swapped gemini for xai in the seed config, compose env, plan docs, and the mcp/docs/gateway seed copy. The intent was to add xAI, not to drop Gemini: put the gemini provider back in every one of those spots, reading env.GOOGLE_API_KEY as before, so the gateway targets anthropic / openai / openrouter / gemini / xai. Provider order in both config.json files matches the admin UI's canvas column (PR #1676), which already renders all five. No Go changes: nothing server-side hardcodes the provider list, and the x-goog-api-key transport tests never stopped covering Gemini.
…ffload and retention config
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
…l-s3-log-offload-retention-1788811143
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated with Hive: Add conditional S3 log offload and extend retention to 100 years in gateway