Skip to content

Commit 3519293

Browse files
authored
Merge branch 'main' into msukkari/oss_licenses
2 parents 50fb52a + 9921abc commit 3519293

File tree

24 files changed

+658
-314
lines changed

24 files changed

+658
-314
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
- Increased `SOURCEBOT_CHAT_MAX_STEP_COUNT` default from 20 to 100 to allow agents to perform more autonomous steps. [#1017](https://github.com/sourcebot-dev/sourcebot/pull/1017)
12+
13+
## [4.15.9] - 2026-03-17
14+
15+
### Added
16+
- Added read-only annotations to MCP tools for compatibility with Cursor Ask mode and other MCP clients that restrict tool usage based on behavior hints. [#1013](https://github.com/sourcebot-dev/sourcebot/pull/1013)
17+
18+
## [4.15.8] - 2026-03-17
19+
20+
### Added
21+
- Added support for connecting to Redis over TLS via `REDIS_TLS_ENABLED` and related environment variables. [#1011](https://github.com/sourcebot-dev/sourcebot/pull/1011)
22+
23+
### Changed
24+
- `filterByFilepaths` in the MCP `search_code` tool now accepts regular expressions matched against the full file path, instead of treating values as escaped literals. [#1008](https://github.com/sourcebot-dev/sourcebot/pull/1008)
25+
26+
### Fixed
27+
- Connection sync job failures now log the actual error reason instead of a generic message. [#1012](https://github.com/sourcebot-dev/sourcebot/pull/1012)
28+
29+
## [4.15.7] - 2026-03-16
30+
1031
### Added
1132
- Added AGENTS.md with Cursor Cloud development environment instructions. [#1001](https://github.com/sourcebot-dev/sourcebot/pull/1001)
1233
- Added support for configuring SMTP via individual environment variables (SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD) as an alternative to SMTP_CONNECTION_URL. [#1002](https://github.com/sourcebot-dev/sourcebot/pull/1002)
34+
- Added `DISABLE_API_KEY_CREATION_FOR_NON_OWNER_USERS` and `DISABLE_API_KEY_USAGE_FOR_NON_OWNER_USERS` environment variables to restrict API key creation and usage to organization owners. [#1007](https://github.com/sourcebot-dev/sourcebot/pull/1007)
35+
36+
### Changed
37+
- Deprecated `EXPERIMENT_DISABLE_API_KEY_CREATION_FOR_NON_ADMIN_USERS` in favour of `DISABLE_API_KEY_CREATION_FOR_NON_OWNER_USERS`. The old variable will continue to work as a fallback. [#1007](https://github.com/sourcebot-dev/sourcebot/pull/1007)
1338

1439
## [4.15.6] - 2026-03-13
1540

CLAUDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,5 @@ PR description:
247247

248248
After the PR is created:
249249
- Update CHANGELOG.md with an entry under `[Unreleased]` linking to the new PR. New entries should be placed at the bottom of their section.
250-
- If the change touches `packages/mcp`, update `packages/mcp/CHANGELOG.md` instead
251250
- Do NOT add a CHANGELOG entry for documentation-only changes (e.g., changes only in `docs/`)
252251
- Enterprise-only features (gated by an entitlement) should be prefixed with `[EE]` in the CHANGELOG entry (e.g., `- [EE] Added support for ...`)

docs/api-reference/sourcebot-public.openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Sourcebot Public API",
5-
"version": "v4.15.6",
5+
"version": "v4.15.9",
66
"description": "OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing."
77
},
88
"tags": [

docs/docs.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@
2626
"pages": [
2727
"docs/deployment/docker-compose",
2828
"docs/deployment/k8s",
29-
"docs/deployment/sizing-guide"
29+
"docs/deployment/sizing-guide",
30+
{
31+
"group": "Infrastructure",
32+
"pages": [
33+
"docs/deployment/infrastructure/architecture",
34+
"docs/deployment/infrastructure/redis"
35+
]
36+
}
3037
]
3138
}
3239
]
@@ -81,6 +88,7 @@
8188
"group": "Configuration",
8289
"pages": [
8390
"docs/configuration/config-file",
91+
"docs/configuration/environment-variables",
8492
{
8593
"group": "Indexing your code",
8694
"pages": [
@@ -110,7 +118,6 @@
110118
"docs/configuration/auth/faq"
111119
]
112120
},
113-
"docs/configuration/environment-variables",
114121
"docs/license-key",
115122
"docs/configuration/transactional-emails",
116123
"docs/configuration/structured-logging",

docs/docs/configuration/environment-variables.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following environment variables allow you to configure your Sourcebot deploy
2323
| `FORCE_ENABLE_ANONYMOUS_ACCESS` | `false` | <p>When enabled, [anonymous access](/docs/configuration/auth/access-settings#anonymous-access) to the organization will always be enabled</p>
2424
| `REQUIRE_APPROVAL_NEW_MEMBERS` | - | <p>When set, controls whether new users require approval before accessing your deployment. If not set, the setting can be configured via the UI. See [member approval](/docs/configuration/auth/access-settings#member-approval) for more info.</p>
2525
| `REDIS_DATA_DIR` | `$DATA_CACHE_DIR/redis` | <p>The data directory for the default Redis instance.</p> |
26-
| `REDIS_URL` | `redis://localhost:6379` | <p>Connection string of your Redis instance. By default, a Redis database is automatically provisioned at startup within the container.</p> |
26+
| `REDIS_URL` | `redis://localhost:6379` | <p>Connection string of your Redis instance. By default, a Redis database is automatically provisioned at startup within the container.</p><p>To enable TLS, see [this doc](/docs/deployment/infrastructure/redis#tls).</p> |
2727
| `REDIS_REMOVE_ON_COMPLETE` | `0` | <p>Controls how many completed jobs are allowed to remain in Redis queues</p> |
2828
| `REDIS_REMOVE_ON_FAIL` | `100` | <p>Controls how many failed jobs are allowed to remain in Redis queues</p> |
2929
| `REPO_SYNC_RETRY_BASE_SLEEP_SECONDS` | `60` | <p>The base sleep duration (in seconds) for exponential backoff when retrying repository sync operations that fail</p> |
@@ -53,6 +53,9 @@ The following environment variables allow you to configure your Sourcebot deploy
5353
| `PERMISSION_SYNC_REPO_DRIVEN_ENABLED` | `true` | <p>Enables/disables [repo-driven permission syncing](/docs/features/permission-syncing#how-it-works). Only applies when `PERMISSION_SYNC_ENABLED` is `true`.</p> |
5454
| `EXPERIMENT_EE_PERMISSION_SYNC_ENABLED` **(deprecated)** | `false` | <p>Deprecated. Use `PERMISSION_SYNC_ENABLED` instead.</p> |
5555
| `AUTH_EE_ALLOW_EMAIL_ACCOUNT_LINKING` | `true` | <p>When enabled, different SSO accounts with the same email address will automatically be linked.</p> |
56+
| `DISABLE_API_KEY_CREATION_FOR_NON_OWNER_USERS` | `false` | <p>When enabled, only organization owners can create API keys. Non-owner members will receive a `403` error if they attempt to create one.</p> |
57+
| `EXPERIMENT_DISABLE_API_KEY_CREATION_FOR_NON_ADMIN_USERS` **(deprecated)** | `false` | <p>Deprecated. Use `DISABLE_API_KEY_CREATION_FOR_NON_OWNER_USERS` instead.</p> |
58+
| `DISABLE_API_KEY_USAGE_FOR_NON_OWNER_USERS` | `false` | <p>When enabled, only organization owners can create or use API keys. Non-owner members will receive a `403` error if they attempt to create or authenticate with an API key. If you only want to restrict creation (not usage), use `DISABLE_API_KEY_CREATION_FOR_NON_OWNER_USERS` instead.</p> |
5659

5760

5861
### Review Agent Environment Variables
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Architecture Overview
3+
url: /docs/overview#architecture
4+
sidebarTitle: Architecture Overview
5+
---
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Redis
3+
sidebarTitle: Redis
4+
---
5+
6+
Sourcebot uses Redis as a job queue for background indexing work.
7+
8+
## TLS
9+
10+
To enable TLS for your Redis connection, set `REDIS_TLS_ENABLED=true`. You can also enable TLS implicitly by using a `rediss://` connection string in `REDIS_URL`.
11+
12+
| Variable | Default | Description |
13+
| :------- | :------ | :---------- |
14+
| `REDIS_TLS_ENABLED` | `false` | Enable TLS for the Redis connection. Alternatively, enable tls via `rediss://` connection string. |
15+
| `REDIS_TLS_CA_PATH` | - | Path to the CA certificate for the Redis connection. |
16+
| `REDIS_TLS_CERT_PATH` | - | Path to the certificate for the Redis connection. |
17+
| `REDIS_TLS_KEY_PATH` | - | Path to the private key for the Redis connection. |
18+
| `REDIS_TLS_KEY_PASSPHRASE` | - | Passphrase for encrypted private keys. Required if your TLS private key is password-protected. |
19+
| `REDIS_TLS_SERVERNAME` | - | Server name for SNI (Server Name Indication). Useful when connecting to Redis through a proxy or with custom certificates. |
20+
| `REDIS_TLS_REJECT_UNAUTHORIZED` | `true` | Set to `false` to disable certificate validation. Not recommended for production. When not set, defaults to Node.js secure behavior. |
21+
| `REDIS_TLS_CHECK_SERVER_IDENTITY` | - | Set to `false` to bypass server identity checking. Use with caution in enterprise environments with custom certificate setups. |
22+
| `REDIS_TLS_SECURE_PROTOCOL` | - | TLS protocol version (e.g., `TLSv1_2_method`, `TLSv1_3_method`). Uses Node.js defaults when not set. |
23+
| `REDIS_TLS_CIPHERS` | - | Custom cipher suite configuration. Allows specification of allowed TLS ciphers for enhanced security requirements. |
24+
| `REDIS_TLS_HONOR_CIPHER_ORDER` | - | Set to `true` to use server’s cipher order preference instead of client’s. Useful for enforcing security policies. |

packages/backend/src/connectionManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export class ConnectionManager {
378378
this.promClient.activeConnectionSyncJobs.dec({ connection: connection.name });
379379
this.promClient.connectionSyncJobFailTotal.inc({ connection: connection.name });
380380

381-
jobLogger.error(`Failed job ${job.id} for connection ${connection.name} (id: ${connection.id}). Failing job.`);
381+
jobLogger.error(`Failed job ${job.id} for connection ${connection.name} (id: ${connection.id}). Reason: ${job.failedReason}`);
382382

383383
const config = connection.config as unknown as ConnectionConfig;
384384
captureEvent('backend_connection_sync_job_failed', {

packages/backend/src/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { createLogger, env, getConfigSettings, getDBConnectionString, hasEntitle
66
import 'express-async-errors';
77
import { existsSync } from 'fs';
88
import { mkdir } from 'fs/promises';
9-
import { Redis } from 'ioredis';
109
import { Api } from "./api.js";
1110
import { ConfigManager } from "./configManager.js";
1211
import { ConnectionManager } from './connectionManager.js';
@@ -18,6 +17,7 @@ import { RepoPermissionSyncer } from './ee/repoPermissionSyncer.js';
1817
import { shutdownPosthog } from "./posthog.js";
1918
import { PromClient } from './promClient.js';
2019
import { RepoIndexManager } from "./repoIndexManager.js";
20+
import { redis } from "./redis.js";
2121

2222
const logger = createLogger('backend-entrypoint');
2323

@@ -39,10 +39,6 @@ const prisma = new PrismaClient({
3939
},
4040
});
4141

42-
const redis = new Redis(env.REDIS_URL, {
43-
maxRetriesPerRequest: null
44-
});
45-
4642
try {
4743
await redis.ping();
4844
logger.info('Connected to redis');
@@ -116,7 +112,7 @@ const listenToShutdownSignals = () => {
116112
await redis.quit();
117113
await api.dispose();
118114
await shutdownPosthog();
119-
115+
120116
logger.info('All workers shut down gracefully');
121117
signals.forEach(sig => process.removeListener(sig, cleanup));
122118
return 0;

packages/backend/src/redis.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { env } from "@sourcebot/shared";
2+
import { Redis } from 'ioredis';
3+
import fs from "fs";
4+
5+
const buildTlsOptions = (): Record<string, unknown> => {
6+
if (env.REDIS_TLS_ENABLED !== "true" && !env.REDIS_URL.startsWith("rediss://")) {
7+
return {};
8+
}
9+
10+
return {
11+
tls: {
12+
ca: env.REDIS_TLS_CA_PATH
13+
? fs.readFileSync(env.REDIS_TLS_CA_PATH)
14+
: undefined,
15+
cert: env.REDIS_TLS_CERT_PATH
16+
? fs.readFileSync(env.REDIS_TLS_CERT_PATH)
17+
: undefined,
18+
key: env.REDIS_TLS_KEY_PATH
19+
? fs.readFileSync(env.REDIS_TLS_KEY_PATH)
20+
: undefined,
21+
...(env.REDIS_TLS_REJECT_UNAUTHORIZED
22+
? { rejectUnauthorized: env.REDIS_TLS_REJECT_UNAUTHORIZED === 'true' }
23+
: {}),
24+
...(env.REDIS_TLS_SERVERNAME
25+
? { servername: env.REDIS_TLS_SERVERNAME }
26+
: {}),
27+
...(env.REDIS_TLS_CHECK_SERVER_IDENTITY === "false"
28+
? { checkServerIdentity: () => undefined }
29+
: {}),
30+
...(env.REDIS_TLS_SECURE_PROTOCOL
31+
? { secureProtocol: env.REDIS_TLS_SECURE_PROTOCOL }
32+
: {}),
33+
...(env.REDIS_TLS_CIPHERS ? { ciphers: env.REDIS_TLS_CIPHERS } : {}),
34+
...(env.REDIS_TLS_HONOR_CIPHER_ORDER
35+
? {
36+
honorCipherOrder: env.REDIS_TLS_HONOR_CIPHER_ORDER === "true",
37+
}
38+
: {}),
39+
...(env.REDIS_TLS_KEY_PASSPHRASE
40+
? { passphrase: env.REDIS_TLS_KEY_PASSPHRASE }
41+
: {}),
42+
},
43+
};
44+
};
45+
46+
47+
export const redis = new Redis(env.REDIS_URL, {
48+
maxRetriesPerRequest: null,
49+
...buildTlsOptions(),
50+
});

0 commit comments

Comments
 (0)