Skip to content

feat: edit API connections; chat-only knowledge spaces - #487

Merged
bl0rb merged 3 commits into
mainfrom
feat/api-connection-edit-and-chat-only-spaces
Dec 1, 2026
Merged

bl0rb merged 3 commits into
mainfrom
feat/api-connection-edit-and-chat-only-spaces

Conversation

@bl0rb

@bl0rb bl0rb commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Two independent changes, plus a follow-up that closes the remaining chat-only gaps.

1. Edit API connections (8b85588)

The pencil on an API connection only renamed it, although PATCH /import/sources/{id} already accepts base URL, auth type, username, credential and api_config. A broken connection (e.g. wrong base URL) could only be deleted and set up again.

  • ApiSetupDialog takes an optional source and edits that connection: prefilled, PATCH instead of POST, tested right after saving.
  • An empty credential keeps the stored one; a changed auth type requires a new one. Preset details for the other auth types are filled in.
  • Only admins send allow_private_target; if the backend drops the private-target release (non-admin retargeted the connection), the dialog says so.
  • No closing while the save request runs; a late test result of a closed dialog no longer closes another connection's dialog.

2. Chat-only knowledge spaces – „Nur im Chat“ (8be754a)

Employees may see internal content in the Weave chat; an external service provider using the search API, OpenAI-compatible API, MCP or tool REST must not.

  • collections.chat_only (ingest migration 0066, knowledge migration 0010), synced to retrieval; switch in the space settings.
  • Retrieval GET /collections omits chat-only spaces unless include_chat_only=true, which only chat paths send (runtime for chat users, API chat surfaces, tools delegation-token re-check).
  • Technical identities lose such spaces at introspection, even when assigned.
  • Contracts (chunk-store.md, technical-identities.md, openapi.json) updated.

3. Chat-only: close the remaining gaps (8f76ded)

  • Ingest portal API: a request with a non-admin personal API token (Bearer pd_...) gets no role on chat-only spaces (collection_role / member_collection_filter). It cannot list them or read, download or upload their documents. Admin tokens keep full control (admins can switch the flag; Knowledge's sync account is an admin).
  • Webhooks: jobs in chat-only spaces create and send no deliveries; the review-due fan-out skips such spaces.
  • Weave-API: only the browser session cookie counts as the chat. Bearer tokens get no chat-only spaces via /v1/chat, /v1/chat/stream, /v1/collections, cited passages or release images.
  • ⚠️ Behaviour change: chat-UI users who sign in with a personal token instead of SSO no longer see chat-only spaces.

Tests

  • Ingest frontend: full suite (511), typecheck, lint passed before the commits were split; new edit-mode regression tests in api-setup-dialog.test.tsx.
  • Chat-only change: relevant backend/frontend suites, typecheck and lint reported passing by the session that built it.
  • Not re-run after splitting into two commits; CI covers that.
  • Follow-up (8f76ded), run locally: ingest backend full suite 1876 passed / 2 skipped; Weave-API full suite 494 passed; ingest frontend space-settings test passed. New regression tests: test_api_tokens_never_reach_chat_only_spaces (verified to fail without the guard), test_dispatch_job_event_never_leaves_a_chat_only_space, tests/test_chat_only_channel.py.

🤖 Generated with Claude Code

Mathias and others added 3 commits December 1, 2026 17:19
The pencil on an API connection only renamed it, although
PATCH /import/sources/{id} already accepts base URL, auth type, username,
credential and api_config. A broken connection could only be deleted and
set up again.

- ApiSetupDialog takes an optional `source` and then edits that connection:
  prefilled from the stored settings, PATCH instead of POST, tested right
  after saving. An empty credential keeps the stored one; a changed auth
  type needs a new one. The preset's details of the other auth types are
  filled in, so switching starts from them.
- Only admins send allow_private_target. When the backend drops the
  private-target release (a non-admin retargeted the connection), the
  dialog says so and shows the saved state.
- No closing while the save request runs; a late test result of a closed
  dialog no longer closes another connection's dialog.
- The connections tab opens the dialog instead of the inline rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Employees may see internal content in the Weave chat, but an external
service provider using the search API, the OpenAI-compatible API, MCP or
the tool REST API must not receive it. Instead of a separate space per
audience, a space can now be marked chat-only by its owner.

- collections.chat_only (ingest migration 0066, knowledge migration 0010),
  synced to retrieval; switch in the knowledge-space settings.
- Retrieval's GET /collections leaves chat-only spaces out unless the
  caller asks with include_chat_only=true. Only chat paths do that: the
  runtime for chat users, the API service's chat surfaces and the tools
  service's delegation-token re-check.
- Search API, OpenAI-compatible API, MCP and tool REST never see them;
  technical identities lose them at introspection, even when assigned
  (effective after TECHNICAL_IDENTITY_CACHE_SECONDS).
- Contracts (chunk-store, technical-identities, openapi.json) updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kens

"Nur im Chat" spaces were still reachable outside the browser chat:

- Ingest portal API: a request with a non-admin personal API token
  (Bearer pd_...) now gets no role on chat-only spaces (collection_role and
  member_collection_filter), so it cannot list them or read, download or
  upload their documents. Admin tokens keep full control.
- Webhooks: jobs in chat-only spaces create and send no deliveries, and
  the review-due fan-out skips such spaces.
- Weave-API: only the browser session cookie counts as the chat. Bearer
  tokens get no chat-only spaces via /v1/chat, /v1/chat/stream, the space
  list, cited passages or release images. Chat-UI users who sign in with a
  personal token instead of SSO therefore no longer see them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bl0rb
bl0rb merged commit f7e3853 into main Dec 1, 2026
11 checks passed
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