Repository navigation
feat(gateway): serve free Auto to guests and members, and add provider pins - #5194
Merged
Merged
Conversation
Deploying openwork with
|
| Latest commit: |
089a17c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fbc24724.openwork.pages.dev |
| Branch Preview URL: | https://feature-free-auto-gateway.openwork.pages.dev |
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
…SHA-256 Free credentials and identities were stored as plain SHA-256 digests, which code scanning flags as weak hashing of sensitive data. Den and the Gateway now share one domain-separated helper: identities use a keyed SHA-256 tag and free credentials use a WebCrypto HMAC, matching the Gateway bearer-key store. Free access is off by default and unreleased, so no stored tags need migrating. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BMeBni56bB19LwDFqNsQEw
… OpenAI key Treat signed-out, signed-in and subscribed users as three separate systems: - Signed-out desktops keep dedicated anonymous_inference_* tables with no organization, member, user or key columns. Their allowance is keyed on a machine id carried in the signed proof, so reinstalling does not reset it. - Signed-in members of unsubscribed organizations use their regular OpenWork Models (ow_inf_) key on /api/v1. The proxy serves them only Auto, within a weekly per-person allowance held in inference_free_* tables. The separate ow_auto_ credential and inference_free_keys are removed. - Subscribed organizations keep the existing paid path unchanged. Free requests no longer touch OpenRouter. Both free paths call OpenAI Chat Completions with a single INFERENCE_FREE_OPENAI_API_KEY; revoking that key is the kill switch, and its OpenAI usage shows the running cost. Allowance cost is computed from OpenAI token counts, and requests OpenAI refuses (401, 403, 429) release their hold instead of being charged.
Guests may use free Auto only from the newest three stable desktop releases, with every release supported for at least 14 days after it ships. Each stable release derives its own secret from DESKTOP_FREE_RELEASE_KEY at build time and tags its signed proof with it (proof v3); the gateway derives the same secret from the version the proof claims, so a secret lifted from one release cannot be presented as another and expires with its release. Knobs: DESKTOP_FREE_SUPPORTED_RELEASE_COUNT, DESKTOP_FREE_SUPPORTED_RELEASE_MIN_DAYS, DESKTOP_FREE_BLOCKED_RELEASES, DESKTOP_FREE_RELEASE_KEY_PREVIOUS (rotation overlap), DESKTOP_FREE_FIRST_RELEASE_TAG_VERSION (v2 cutover) and a dev-mode DESKTOP_FREE_DEV_RELEASE_SECRET for unversioned developer builds. The release list comes from GitHub and is served stale for up to a day if GitHub fails. Signed-in members are unaffected.
Guests can assert any machine id, so make a fresh one worth little instead of trying to prove it: the weekly device allowance ramps with the machine's age (ANONYMOUS_INSTALL_RAMP, default $0.10 on day 0, $0.25 from day 1, $0.50 from day 3, full from day 7; a bucket's limit only ever rises within its week), each IP may introduce only a few never-seen machines a day (ANONYMOUS_IP_NEW_IDENTITIES_PER_DAY, default 5), and minting a guest session costs a small proof of work bound to the proof's single-use nonce (ANONYMOUS_SESSION_POW_BITS, default 20). First sightings live in the guest-only anonymous_inference_identities table.
… raise the session proof of work to 23 bits
…and tighten the proof of work The device allowance now ramps on active minutes rather than wall-clock age: every signed guest request is a heartbeat, and the time since the previous one is credited only when the gap is short enough to mean the app stayed open (ANONYMOUS_ACTIVITY_MAX_GAP_MS, default 3 minutes). Default tiers: $0.10, then $0.20 after 10 active minutes, $0.50 after 20, the full $1 after 30. The session proof of work becomes eight 20-bit puzzles instead of one 23-bit puzzle, so the time to solve clusters around one to three seconds instead of occasionally taking many times longer; verification stays eight hashes.
Brings in centralized Gateway usage management (#5139), per-member Google Vertex sign-in (#5236) and Mistral providers (#5264). Our migration moves to 0111 on top of dev's 0108-0110 with an unchanged table set; the DB test now upgrades from the 0110 snapshot. dev's shared session-cache helper replaces our local copy in the management-boundary test.
…uto and split the gateway by audience
Free Auto's rules had to be identical in the gateway, the desktop relay and the
desktop app, but lived as copies in each. They now live once in
packages/free-auto:
- `.` protocol (routes, headers, proof and release-tag messages,
signable routes), proof-of-work parameters and verification,
desktop version and release-window rules
- `./accounting` usage cost, reservation size, the activity ramp
- `./node` SHA-256, release secret and tag HMACs, the proof-of-work solver
and a worker built from the verifier's own functions
@openwork/types/desktop-free-access is removed; its contents moved unchanged.
The gateway's thirteen flat free-Auto files become src/free/{guest,member,shared}
behind one entry, with shared/ never importing guest/ or member/. That removes
three inverted imports (request parsing reaching into the guest proof module,
the gate reaching into dispatch for its error helper, config reaching into the
release source for a URL). Behaviour and test counts are unchanged.
The gateway, den and den-gateway images copy and build the new package.
Contributor
The deploymentEnabled overrides named this stack's branches and would have landed in dev's Vercel config; previews build normally again.
Moved down from the picker PR: it is Gateway accounting. A member's free Auto request writes the same write-ahead Gateway request log as every other route (route openwork_free, against the member's key); if that record cannot be written the request fails closed and the reservation is released without an upstream call. Guest requests are never attributed to an organization. Migration 0112 adds the openwork_free route to the request-log enums.
…ease window The release source capped the list at 1 MB, but GitHub's last 20 OpenWork releases, with notes and assets, are about 1.7 MB. Every refresh was rejected, so guests would have been refused as desktop_version_unavailable. The cap is now 8 MB, and a regression test uses a list of realistic size.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dev added migration 0114 (audit operation capture), so the free Auto migration is regenerated on top of it as 0115_free_auto_and_provider_pins (same statements). Provider create keeps dev's audit-assigned id and the pins column. openapi.json and the SDK are regenerated.
Free Auto now follows the paid Models pattern. Before a request it checks that each window's used total is below its limit. Afterwards it charges the real cost once, keyed on OpenAI's completion id. When no usage report arrives, it charges a fixed estimate. Nothing is held up front, so parallel requests from one person (subagents, parallel chats, title generation) run as they do on paid Models. Removed: reservations and reservation charges, the single-row control tables, the one-request-per-person lock, the global in-flight count, the per-IP daily spend window, the member global caps, the per-request and per-proof rate counters, the 4,096-token output cap, the input-size pre-check, and the whole-stream timeout. Migration 0115 is regenerated with seven tables: usage windows and one usage record per request (for guests and for members), plus machine identities, proof signatures and the new-machine counter.
# Conflicts: # packages/docs/openapi.json
# Conflicts: # packages/docs/openapi.json
# Conflicts: # ee/packages/den-db/drizzle/meta/0115_snapshot.json # ee/packages/den-db/drizzle/meta/_journal.json # packages/docs/openapi.json
benjaminshafii
approved these changes
Sep 30, 2026
This branch was successfully deployed
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.
What is this about?
Guests and members of unsubscribed organizations can use free Auto without provider keys. Subscribed organizations keep paid Models.
What problem does it solve?
People need a useful starter model, with free allowance kept separate from paid billing and guest access protected against abuse.
What was the situation before?
Gateway offered no free route for guests or members, and organization models had no ordered pins.
How is this implemented?
packages/free-auto.openwork_free; preserve paid billing and reject free requests when access is disabled.What else changed?
CIDR proxy trust, a release-key fingerprint, and an isolated free database pool support guest admission. The release branch includes current integration changes.
Release note
Free Auto provides a starter model for guests and members without a paid Models subscription.
Evidence
No E2E; Gateway unit and real-MySQL tests cover admission, idempotent accounting, caps, and simultaneous member requests before → after allowance settlement.