Skip to content

v0.8.54: org apis, file search optimizations, document caching fix - #8130

Merged
waleedlatif1 merged 5 commits into
mainfrom
staging
Sep 22, 2026
Merged

waleedlatif1 merged 5 commits into
mainfrom
staging

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

…, partial outcomes and slow completion counts (#8126)

* fix(knowledge): leave a connector whose credential was removed unscheduled instead of walking the failure ladder to disabled

* fix(knowledge): report a partial connector sync as an outcome instead of failing the run

* fix(knowledge): count a connector's documents before the completion locks and index the live set

* fix(billing): serve execution admission from the usage gate cache instead of re-summing the billing period per run

* fix(knowledge): share the unscheduled connector write, scope credential removal to content-engine modes, and keep both sync holds visible

* fix(knowledge): keep the corpus size on a failed completion count, unschedule only connectors left without an auth source, and give fixture connectors a credential

* fix(knowledge): skip a required-key connector without a key and write the unscheduled state only over the row the run observed

* fix(knowledge): release a dispatch-marked pending row when its credential is missing

* fix(knowledge): assert the billing owner before the credential-missing terminal write

* fix(knowledge): stop offering reconnect once a connector holds a credential again
* feat(api): expose organization access and usage operations

* fix(api): enforce current invitation and organization scope

* fix(billing): serialize credit caps with access revocation

* fix(workspaces): align detachment with invitation lock order
…gainst other files (#8129)

* fix(files): stop promising immutable caching for documents compiled against other files

A versioned serve URL (`?v=<updatedAt>`) was always answered with a one-year
`immutable` Cache-Control. That holds for a stored source — a content write
rotates the storage key, so a given key's bytes never change — but not for a
response the route resolves against OTHER files: a document compiled against the
files it references, or a sim page inlining its images, recompiles on every
request. Those bytes change when a referenced file changes, while this file's key
and `updatedAt` stay put, so the whole URL is unchanged and the browser served a
stale render from cache until the document itself was edited.

The resolver now reports when it read referenced content, and the route withholds
the immutable lifetime for exactly those responses, keeping it for stored sources
and self-contained artifacts.

Also corrects three comments that claimed generated docs are edited in place under
the same storage key. That stopped being true in #5545 (2026-07-13), which made
every content write allocate a new key; the caching rule above was reasoned from
the stale claim.

* improvement(files): make serve cacheability a declared, required property

An optional boolean let a branch added to the resolver inherit the cacheable
default by saying nothing — the exact failure this change exists to prevent.
Cacheability is now a required field every branch must declare, so forgetting it
fails the build rather than silently promising a year of immutability.

* improvement(files): answer a file revalidation with 304 instead of the whole body

A response the browser is told to revalidate carried no validator, so every check
re-sent the entire file. That is the cost a document compiled against other files
now pays on each window focus: it cannot be given a cache lifetime, because its
bytes really may have changed, so the only way to make the check cheap is to let
the client prove what it already holds.

Authorized serves now carry an ETag — the digest of the bytes about to be sent,
which is exact by construction however those bytes were produced — and answer 304
to a matching If-None-Match. Matching is weak, per RFC 9110, so a cache that
stored a weak validator still revalidates.

Kept out of createFileResponse deliberately: digesting costs a pass over the
buffer, up to the 100MB transfer ceiling, and a response served as immutable is
never revalidated, so it would pay that pass and never collect. Public assets and
the assistant-image path are unchanged.

* fix(files): report a reference dependency from the isolated-VM compile path

The isolated-VM fallback returns before the static reference scan, so a document
it compiled never reported one — yet that path reads workspace files live through
its broker, which is what `onWorkspaceFileAccess` records. A versioned request for
such a document therefore still took a one-year immutable lifetime, and changing a
referenced file left the browser serving a stale render.

Fixed at the root rather than in that one branch: the flag is now required on
CompiledDocResult, so every compile path must declare it and a new one cannot
inherit a cacheable-forever answer by staying silent. Each site reports the union
of what the source references statically and what the compile actually touched —
neither alone is sufficient, since a failed read records no access and the broker
reaches files the static scan cannot see.

Making it required immediately surfaced a second case: the process-local compile
cache is shared with compiles that carried a workspace, so a cached entry can hold
contributor identities even when the reading call passes none. That branch now
reads the cached identities instead of assuming independence.

* improvement(files): compute a validator only where a response can be revalidated

Both reviewers caught the same contradiction: the digest was documented as worth
paying only where a 304 can be collected, then applied to every authorized serve
including immutable ones, which are never revalidated. One place now decides, so
an immutable response takes the plain path and spends no pass over its buffer.

Also drops a redundant translation. The resolver was converting the compiler's
boolean into a string union and the cache rule was converting it straight back;
the producer's own required boolean now travels end to end, which is one fact in
one shape and keeps the same build-time guarantee that a new branch must declare it.
@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 22, 2026 6:45am UTC

Request Review

@waleedlatif1
waleedlatif1 merged commit a81b0e1 into main Sep 22, 2026
50 checks passed
@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, migration, or interface defect remained after review.

Summary

This release expands the public organization and access-request API/CLI surfaces while hardening several existing operational paths.

  • Adds organization access-request, usage, member-limit, invitation, workspace-permission, OpenAPI, MCP, and CLI operations.
  • Reworks authorization-sensitive operations around shared application use cases and current principal policy.
  • Makes connector synchronization resilient to removed credentials, partial runs, and slow document-count queries.
  • Keeps workspace-file dispatch claims on the ordered pending index.
  • Revalidates compiled documents whose bytes depend on referenced files instead of caching them immutably.
  • Adds the matching live-document partial index, pagination tests, PostgreSQL coverage, and UI navigation/empty-state refinements.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Client[Web UI / CLI / API client] --> Routes[Internal and public v2 routes]
  Routes --> Auth[Principal, role, scope, and entitlement checks]
  Auth --> UseCases[Shared application use cases]
  UseCases --> Org[Organization access, invitations, and usage]
  UseCases --> Knowledge[Connector synchronization]
  UseCases --> Files[Workspace-file serving and search]
  Knowledge --> DB[(PostgreSQL)]
  Files --> DB
  Files --> Cache[Immutable or ETag-revalidated response]
Loading

Reviews (1) · Last reviewed commit: "fix(files): stop promising immutable cac..."

This branch was previously deployed

1 inactive deployment
Preview 32fcc637 Deployed Sep 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant