Skip to content

Venice Web source always reports "session cookie not found" — venice.ai sign-in now uses Clerk #3940

Description

@LachieFREEDOM

Summary

With Source: Web, the Venice provider reports Venice browser session cookie not found. Sign in to venice.ai in your browser. even while signed in to venice.ai in Chrome.

The Web path only recognises the __venice-auth.session-token cookie family (VeniceCookieHeader.isSessionCookieName). A fresh venice.ai sign-in no longer sets that cookie. It sets Clerk cookies instead. Because VeniceWebUsageFetcher.requireSessionCookieHeader applies the same filter, Manual cookie mode is affected too.

Environment

  • CodexBar 0.65.0 (latest release); the Venice cookie code is unchanged on main at 5f70bfc
  • macOS 27.0 (arm64), Google Chrome 153, default profile
  • venice.ai account signed in through the website

Steps to reproduce

  1. Sign in at venice.ai in Chrome.
  2. In CodexBar, set Venice → Source to Web.
  3. Refresh, or run codexbar usage --provider venice --source web --format json.

Expected: subscription-credit details, as added in #3474.
Actual: missingCredentials → "Venice browser session cookie not found."

Evidence

Cookie names only for venice.ai after sign-in (no cookie values were read or decrypted):

Host Auth-relevant cookie names
venice.ai __session, __session_<suffix>, clerk_active_<suffix>
.venice.ai __client_uat, __client_uat_<suffix>
.clerk.venice.ai __client (HttpOnly)
venice.ai (leftover) __Host-authjs.csrf-token, __Secure-authjs.callback-url

There are no __venice-auth.session-token or __venice-auth.session-token.N cookies. The leftover Auth.js cookies suggest venice.ai moved from Auth.js to Clerk.

The current venice.ai web client (public JS bundle) still calls https://outerface.venice.ai/api/user/session and still validates the response as { token: string }. It now authenticates that call with Authorization: Bearer <Clerk session token> from Clerk.session.getToken(), alongside credentials: "include". An unauthenticated GET returns 401 with a JSON { "error": ... } body.

Not verified

  • Whether /api/user/session accepts the Clerk token from a non-browser client, either as a Bearer header or as a __session cookie.
  • Whether the returned token still carries the bundledCreditsUsage claims the parser expects.

I didn't send a real session to confirm either point. I'm happy to run a probe build if that helps.

Possible directions (your call)

  1. Clearer failure (small). When Clerk cookies are present but the legacy cookie is not, report that the Venice sign-in format is unsupported. Today's "cookie not found" error sends users into sign-in loops.
  2. Use __session as a Bearer token. Accept __session and __session_<suffix>, then send the value as Authorization: Bearer to /api/user/session. Clerk session tokens expire after 60 seconds, and the browser only refreshes the cookie while a venice.ai tab is active. Most background refreshes would probably hit the existing expiredSession path.
  3. Mint a fresh token the way Clerk's frontend does. Use the long-lived __client cookie, which is HttpOnly and set on the Clerk frontend-API host. This is durable, but it reads a more privileged credential than the Web source reads today. That trade-off seems like a maintainer decision.

A synthetic parser test for directions 1 and 2 might look like this (fake values):

@Test
func `clerk session cookie is recognised`() {
    let raw = "__client_uat=1700000000; __session=eyJhbGciOiJub25lIn0.eyJleHAiOjB9."
    #expect(VeniceCookieHeader.header(from: raw) != nil)
}

@Test
func `legacy session cookie still wins when present`() {
    let raw = "__session=eyJhbGciOiJub25lIn0.eyJleHAiOjB9.; __venice-auth.session-token=synthetic"
    #expect(VeniceCookieHeader.header(from: raw) == "__venice-auth.session-token=synthetic")
}

Related: #3474 (Web credits), #3804 (shared browser cookie import).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions