fix#15867
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Workspace manifests now reference only the current avatar, including
when the workspace document is incomplete. Stale avatars and unrelated
image references are no longer treated as accessible through the
manifest.
* Generated images can be returned inline when a signed link is
unavailable, avoiding unnecessary failures in that case. Image results
and remotely fetched images are also stored consistently.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15883** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Document creation can now recover incomplete registrations without
recreating document content.
* Document updates can detect revision conflicts, helping prevent
changes from overwriting newer edits.
* **Improvements**
* Document sync and update handling are improved across desktop,
Android, and iOS.
* Workspace metadata and legacy document pages are handled more
consistently during migration and recovery.
* Creator and editor details are better preserved when documents are
recovered or compacted.
* **Configuration**
* Removed the experimental document-merge setting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15854** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added workspace document lifecycle tracking, including trashed and
deleted states, with migration support.
* Added workspace inventory syncing and state refresh across cloud and
local storage, improving document discovery and offline synchronization.
* Added clearer messages for invalid or oversized document updates and
temporarily unavailable sync or validation.
* Added paused-upload diagnostics and a Quick Export shortcut for
relevant workspace sync issues.
* **Improvements**
* Search, indexing, and document metadata now reflect workspace
inventory and lifecycle state.
* Restoring from history preserves concurrent edits made during
recovery.
* Unused-blob checks now scan document content and detect changes during
scanning.
* **Bug Fixes**
* Invalid document updates are rejected without partially saving a
batch.
* Document reading handles missing or cyclic block relationships more
reliably.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15820** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved image handling in AI conversations: supported images are
resized and sent as WebP, with transparency preserved.
* Image attachments that can’t be loaded or encoded now report an error
instead of being silently omitted.
* Invalid image uploads now receive clearer error messages, while
unrelated processing errors retain their original details.
* Copilot message errors now surface more directly, while missing or
inaccessible sessions continue to be reported as unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15817** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added managed Copilot model routing with route choices and defaults
based on available configuration.
* Expanded model routing support to include OpenRouter and additional
request formats.
* Route options are now available for self-hosted deployments when
configured targets support them.
* **Bug Fixes**
* Added clearer errors when a selected Copilot target is unavailable.
* Improved configuration migration behavior to preserve custom model
profiles and legacy credentials.
* Cloud deployments now receive a clear configuration error when
attempting to set Copilot provider profiles.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15482
#### PR Dependency Tree
* **PR #15811** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved CalDAV account setup across server configurations, including
servers that redirect discovery requests or use relative calendar links.
* CalDAV connection errors for unauthorized or forbidden access are now
surfaced without attempting fallback requests.
* Calendar and event retrieval continues to work across supported
discovery scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15794** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved search reliability when documents are changing, including
more consistent handling of invalid or incomplete document data.
* Prevented overlapping scheduled search updates, helping keep
background processing consistent.
* Improved coordination between search projections and payment
processing when both operate on document snapshots.
* Search processing now better isolates failures, helping other
documents continue to be processed and allowing recovery after source
data changes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15654fix#15551
#### PR Dependency Tree
* **PR #15792** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Session refreshes can now recover from interrupted requests using the
same refresh attempt, including after an app restart.
* **Bug Fixes**
* Retrying a successful refresh no longer unnecessarily rotates tokens
or invalidates the session. Invalid or mismatched retries continue to be
rejected, while expired credentials are handled without revoking an
otherwise valid session.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
`isRefererAllowed` compares `new URL(referer).origin`. For non-special
schemes that is the opaque string `"null"`:
```js
new URL('assets://./').origin // 'null'
new URL('capacitor://localhost/').origin // 'null'
new URL('file:///index.html').origin // 'null'
```
So a `Referer` coming from the desktop (`assets://.`), mobile
(`capacitor://localhost`) or legacy (`file://`) clients can never match
the allowed origins, although the same origins are accepted when they
arrive in an `Origin` header (`DESKTOP_CLIENT_ORIGINS` /
`MOBILE_CLIENT_ORIGINS`, merged into the worker's list since #15547).
Requests that carry only a `Referer`, such as `<img
src=".../api/worker/image-proxy?...">` loads, are rejected with `400
Invalid header`.
This serializes such origins as `protocol//host`, which is how a browser
writes them in an `Origin` header. http(s) referers are unchanged.
Refs #14865 (the `Origin` half of that issue is already fixed on
canary).
## Testing
- Added `plugins/worker/__tests__/headers.spec.ts`: http(s) referers,
custom-scheme referers from the list, custom-scheme referers not in the
list, invalid input.
- I could not run the full `ava` suite locally. The function was checked
in isolation with Node on the same cases (9/9).
## Not included
Allowing `image-proxy` requests that have neither `Origin` nor `Referer`
(bug 3 in #14865). That loosens the check and I could not confirm what
the Electron `<img>` loads actually send.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Referer checks now correctly recognize allowed client origins using
custom URL schemes, alongside allowed HTTP and HTTPS origins. Unlisted
origins and invalid URLs continue to be rejected, helping ensure
requests from supported clients are handled consistently without
broadening access to unapproved origins.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15730** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Payment records missing provider or source identity now require repair
instead of being automatically adopted or matched through legacy
identifiers.
* RevenueCat subscription confirmation checks for expected subscription
identities, and subscription entitlements include provider and
recurrence details.
* Pending uploads with missing expiration dates remain pending during
cutover rather than being marked deleted.
* **Improvements**
* Embedding projections are refreshed when source content or revision
details change, with updated processing order.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15729** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Deployment**
* Updated the Cloud SQL Proxy image and integrated it with deployment
charts.
* Containers now run with stricter security settings, including non-root
execution and read-only filesystems.
* **Desktop**
* Updated Electron and Node versions and adjusted Windows builds to
support multiple architectures.
* **Maintenance**
* Updated Vite and Storybook versions across development tools.
* Improved production GraphQL schema handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15704** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Blob uploads now use the latest workspace storage limit, so uploads
can proceed after a quota change without relying on a stale limit.
* Upload cancellation is limited to the matching upload, preventing
unrelated uploads from being aborted.
* Failed or stale storage reservations can be retried more reliably,
while deleted storage keys and comment attachments remain protected from
unauthorized reuse.
* **Reliability**
* Upload and reservation failures now include contextual logging to aid
troubleshooting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15594
#### PR Dependency Tree
* **PR #15703** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added support for recovering transcripts from MP4 and M4A audio,
alongside existing Ogg and Opus formats.
* Added MP4 audio slicing, including support for edit-list trimming and
checks for invalid or unsupported audio.
* **Bug Fixes**
* Improved handling of unsupported audio inputs during transcript
recovery.
* **Chores**
* Updated the LLM adapter and runtime dependencies.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Workspace selection, creation, and navigation after import now use
consistent view transitions, including in browsers without native
transition support.
* **Chores**
* Updated supporting components for mathematical notation, diagrams,
desktop functionality, and backend services.
* Refreshed tools used by the app and its documentation, including
components for error reporting and GraphQL operations. These updates do
not change the rendered equations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#14261
#### PR Dependency Tree
* **PR #15697** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Meeting transcription can process longer recordings in shorter
sections and combine the results into a transcript and summary.
* If a transcription provider blocks audio, recoverable sections can be
retried. Unavailable sections are marked in the transcript, and
summaries focus on available speech.
* Transcript timestamps are aligned with their audio sections, including
when providers return timestamps in different formats.
* **Bug Fixes**
* Audio transcription failures now display a clear, localized message,
with details available on focus. Long error text wraps within the
player.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15694** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Transcription slices and meeting summaries now retry temporary service
failures and empty model responses, helping recover without restarting
the transcription.
* Transcription stops retrying when a request is cancelled or the
failure cannot be recovered, and reports clearer errors when attempts
are exhausted.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15650fix#15530fix#15534fix#15506
#### PR Dependency Tree
* **PR #15649** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Summary
* **New Features**
* Admin settings show configuration sources and secret status, conceal
secret values, and allow database-level overrides to be cleared.
* Self-hosted deployments can automatically upgrade existing
configuration files.
* **Improvements**
* Configuration changes apply without restarting the server, and storage
settings reload automatically.
* Uploads support runtime-managed proxy settings and signed upload
tokens.
* Incomplete managed Copilot profiles are disabled during migration.
* Saving an AI response as a document more reliably targets the matching
editor.
* **Documentation**
* The CLI clarifies that imported configuration changes take effect
after the next server start.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15644
#### PR Dependency Tree
* **PR #15645** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* The MCP Server integration now appears only when Copilot is enabled.
* MCP credential queries and create, rotate, and revoke actions are
rejected while Copilot is disabled.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15615** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Checkout success links are now safely normalized before being sent to
the payment provider.
- Relative callback paths are converted into valid absolute URLs.
- Empty or missing success callbacks now return customers to the default
application page.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15614** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- OAuth availability now reflects whether active OAuth providers are
configured.
- Payment functionality now automatically follows the payment enablement
setting, including configuration changes.
- Subscription plan settings now validate required Pro and Team pricing
before displaying plans.
- **Bug Fixes**
- Added a retry option when plan pricing cannot be loaded or validated.
- Improved invitation notification handling to ensure notifications
appear reliably after inviting a workspace member.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary
The changes below are prepared locally and have not been committed or
pushed.
- Save original URLs, user titles, selected text, images and PDFs
through a versioned, file-backed Share Inbox. Stable document/attempt
IDs, serialized imports and committed receipts make retries preserve
user edits and recover native completion.
- Keep rich previews transient. Share previews request transcript
excerpts, clip optional display fields and bound response/image
downloads. Saving does not wait for preview requests or persist provider
metadata, transcript snapshots or dedicated preview blobs.
- Restore the minimal App Group workspace-mode snapshot and
`official`/`deferred` route. Official routes remain fixed for the
pending share; deferred self-hosted previews use the selected server
without a provider fallback.
- Let bookmark and YouTube details read the current workspace's Link
Preview API by URL. Full transcripts, chapters and timestamps load on
expansion without document writes. Reuse editor styles and the existing
portal for canvas details; isolate endpoint/base/transcript caches and
keep transcript results out of persistent cache.
## Validation
- Focused frontend suites: 128 tests passed; the 43 preview/details
cases also passed after the final portal change.
- `ShareInboxSafetyTests`: 57 tests passed on iOS 26.5 simulator.
- `yarn typecheck` and full `yarn lint` passed.
- iOS web bundle, Capacitor asset copy, and signed simulator App build
with embedded ShareExtension passed.
- Browser component checks: desktop, narrow viewport, light/dark themes,
full transcript scrolling, canvas portal positioning and Escape
dismissal.
- Simulator Safari share: rich preview, cancellation, native-to-app
handoff, workspace selection and successful save. The pending manifest
contained original content and routing only, and was removed after
import.
Physical-device and network-capture matrices remain manual. The
simulator YouTube iframe displayed player error 153; this is separate
from the successful preview/import checks and video playback is not
claimed as verified.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* iOS sharing now supports PDF files alongside images, with previews and
attachment validation.
* Share imports offer improved workspace selection, offline handling,
retry recovery, and clearer error messages.
* Link previews can display expandable metadata and transcript details
for bookmarks and YouTube embeds.
* Share inbox entries now identify unsupported versions and provide
safer attachment resolution.
* **Bug Fixes**
* Improved cancellation, cleanup, and stale-request handling during
sharing and importing.
* Enhanced link-preview validation and protection against oversized or
invalid responses.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: DarkSky <darksky2048@gmail.com>
fix#15574
#### PR Dependency Tree
* **PR #15575** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## New Features
* Added source-aware blob handling for current documents and page
history.
* Added document lifecycle support for trashing, restoring, and
permanently deleting documents.
* Copilot attachments now upload directly to session attachment
endpoints.
## Bug Fixes
* Document actions now complete before confirmations, notifications, and
navigation proceed.
* Improved cancellation, upload fallback, size-limit handling, and cloud
synchronization reliability.
* Invite-link expiration now remains reliable for long durations.
* Improved synchronization for document permissions and reserved
documents.
## Changes
* Blob management now displays attachment icons instead of image
previews.
* Cloud synchronization now uses a unified batch protocol.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Self-hosted AFFiNE's `/api/worker/link-preview` and
`/api/worker/image-proxy` endpoints forward the requesting browser's
`Accept-Encoding` header to whatever URL they fetch (`cloneHeader()`),
but the underlying native `safeFetch` never decompresses the response
before parsing it. Sites that gzip/brotli-compress their HTML (GitHub
does, for any non-trivially-sized repo page) end up handing AFFiNE
compressed bytes, which the HTMLRewriter meta-tag scraper silently reads
as nothing. The result: link preview cards render with no image, title,
or description.
**Fix:** drop `Accept-Encoding` from the headers forwarded in
`cloneHeader()`, so upstream requests are implicitly identity-encoded
and the response body stays uncompressed for the parsing that follows.
**Before**
<img width="641" height="335" alt="image"
src="https://github.com/user-attachments/assets/8ec8a925-6a1f-422a-9cb0-5e1687a5f75e"
/>
**After**
<img width="659" height="323" alt="image"
src="https://github.com/user-attachments/assets/c35002b5-43c1-4f8b-a4c2-20028f1e453a"
/>
## Checklist
- [x] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [x] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [x] Tests are added or updated where it makes sense
- [x] `yarn lint` and `yarn typecheck` pass locally
- [x] If the PR code includes AI-generated edits, I have carefully
reviewed it to ensure that the scope of the PR is consistent with what
is claimed in the title and description, and that there are no redundant
or invalid implementations.
- [x] I agree that maintainers may close the PR without discussion if
they consider the code quality to be too low.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Prevented `Accept-Encoding` headers from being forwarded when
processing worker link-preview and image-proxy requests.
* Improved request handling to avoid passing client compression
preferences to external fetch targets.
* **Tests**
* Added end-to-end coverage confirming that `Accept-Encoding` is
excluded from forwarded requests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15542** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Invitation links now require sign-in to view or accept.
- Added guidance when an invitation belongs to a different account, with
options to switch accounts or return to AFFiNE.
- Sign-in preserves the invitation link when switching accounts.
- **Bug Fixes**
- Invitation errors now display accurate messages instead of generic
errors.
- Improved handling of expired, invalid, and missing invitations.
- Invitation status checks now work correctly for authenticated
invitees.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary
This change restricts email invitation metadata lookup to the
authenticated user that the invitation was issued to.
## Impact
The public invite-info resolver returns workspace, owner, invitee, and
status details for a valid invitation identifier. For email invitations,
that information should only be returned to the intended recipient after
authentication.
## Fix
- Keep existing link-invitation behavior unchanged.
- For email invitations, require an authenticated user whose id matches
the invitation recipient before returning invitation details.
- Return the existing invalid-invitation error for mismatched or
unauthenticated access.
## Validation
- `git diff --check`
- Full test/lint suite was not run locally because dependencies are not
installed in this checkout.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Tightened invitation access checks so non-link invites are only
readable by the intended recipient.
* Invalid or missing user context now returns an error earlier,
preventing access to invite details when the invitation doesn’t match.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: failsafesecurity <190101117+failsafesecurity@users.noreply.github.com>
Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
#### PR Dependency Tree
* **PR #15538** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added rich link previews to mobile and iOS sharing, including images,
metadata, transcripts, and selected text.
* Share imports can now create structured content blocks, embeds,
bookmarks, and transcript callouts.
* Added workspace-aware preview handling for cloud, self-hosted, and
signed-out modes.
* **Accessibility**
* Improved collapse/expand controls with semantic buttons and ARIA
relationships.
* **Bug Fixes**
* Enhanced URL and error sanitization in server logs.
* Improved link-preview CORS support, validation, and request handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!--
Thank you for contributing to AFFiNE!
The PR title must follow Conventional Commits (enforced by CI):
type(scope): description e.g. fix(editor): keep selection after paste
Types: feat fix docs style refactor perf test build ci chore revert
-->
## Description
<!-- What does this PR do? Link related issues, e.g. "Closes #1234".
Screenshots or recordings are welcome for UI changes. -->
## Checklist
- [ ] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [ ] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [ ] Tests are added or updated where it makes sense
- [ ] `yarn lint` and `yarn typecheck` pass locally
#### PR Dependency Tree
* **PR #15533** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved indexer feature synchronization when the indexer is enabled
or configuration changes.
* Enabled indexer-related capabilities without waiting for native search
readiness checks.
* Improved consistency across search, aggregate, document, and
application startup flows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!--
Thank you for contributing to AFFiNE!
The PR title must follow Conventional Commits (enforced by CI):
type(scope): description e.g. fix(editor): keep selection after paste
Types: feat fix docs style refactor perf test build ci chore revert
-->
## Description
<!-- What does this PR do? Link related issues, e.g. "Closes #1234".
Screenshots or recordings are welcome for UI changes. -->
## Checklist
- [ ] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [ ] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [ ] Tests are added or updated where it makes sense
- [ ] `yarn lint` and `yarn typecheck` pass locally
#### PR Dependency Tree
* **PR #15532** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved search reconciliation and publication status handling when
workspace reconciliation fails.
* Prevented failed workspace reconciliation from incorrectly blocking
generation completion.
* Preserved active generation state so reconciliation can retry and
complete pending publications.
* Improved managed provider profile migration, including legacy
configurations, unavailable models, conflicting assignments, and missing
defaults.
* **Tests**
* Expanded coverage for workspace recovery and managed provider profile
migration scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Self-hosted GitHub OAuth login fails at token exchange because the
outbound request to `https://github.com/login/oauth/access_token` has no
`User-Agent` header. GitHub then returns 403 ("Request forbidden by
administrative rules"), which is surfaced as
`INVALID_OAUTH_CALLBACK_CODE`.
OAuth `safeFetch` only forwarded `authorization`, `content-type`, and
`accept`, so even a User-Agent on the request would be stripped. This
change:
- allows `user-agent` in OAuth `fetchOptions()`
- always sends `User-Agent: AFFiNE-Server` from `fetchJson()` (covers
token exchange and `api.github.com` user/email fetches)
Fixes#15521
## Checklist
- [x] The PR targets the `canary` branch and its title follows
Conventional Commits
- [x] Tests are added or updated where it makes sense
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved OAuth request compatibility by including a standard
`User-Agent` header.
* Ensured the header is permitted consistently during OAuth token
exchanges.
* **Tests**
* Added coverage to verify case-insensitive handling of the `User-Agent`
header in GitHub OAuth requests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
fix#15523fix#15526
#### PR Dependency Tree
* **PR #15528** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Improved search generation cleanup, provider error reporting, and
reconciliation reliability.
- Retired search resources are cleaned up safely, including after
credential changes.
- Prompt size checks now ignore tool parameters and provide clearer
errors.
- Reserved documents are protected from accidental cleanup, and
malformed identifiers are rejected.
- **Configuration**
- Managed Copilot profiles require explicit, non-duplicated model
assignments.
- Improved managed provider profile migration.
- **Performance & Reliability**
- Reduced unnecessary search-history cleanup and adjusted
consistency-check intervals.
- Failed reconciliation jobs stop after one attempt and are removed
automatically.
- **Data Updates**
- Updated legacy AI session prompt names to current labels.
- Improved cloud load-balancer health-check configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #15512** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Search now supports generation-based indexing with embedded and remote
providers.
* Added automatic search reconciliation and improved handling of
document, workspace, and permission changes.
* Added clearer search status errors for unavailable, syncing, unready,
or failed indexes.
* Added Manticore Search end-to-end support and provider-specific search
behavior.
* **Improvements**
* Search and aggregate pagination now report returned results and
continuation status more accurately.
* Improved permission filtering to prevent inaccessible documents from
appearing in results.
* Admin provider selection now consistently enables indexing.
* **Documentation**
* Clarified search pagination, aggregation counts, provider
configuration, and end-to-end setup.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix#15505fix#15502fix#15496fix#15491
#### PR Dependency Tree
* **PR #15510** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added configurable delays for invitations, invite links, and document
publishing by newly created accounts.
- Added workspace action checks that explain blocked actions and retry
timing.
- BYOK setup now verifies model capabilities and saves only validated
options.
- **Bug Fixes**
- Improved BYOK probing for chat, structured responses, tool calls,
embeddings, reranking, and image generation.
- Preserved probe request order and strengthened response validation.
- Authentication configuration changes now reload correctly.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->