Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- [EE] Added prompt caching for Ask Sourcebot. For Anthropic models, the static prompt prefix (tool definitions, system prompt, and conversation history) is marked with a cache breakpoint so it is billed at the provider's discounted cache-read rate on subsequent agent steps and follow-up turns. Toggle with `SOURCEBOT_CHAT_PROMPT_CACHING_ENABLED` (default `true`). [#1278](https://github.com/sourcebot-dev/sourcebot/pull/1278)
- [EE] Added a cached-token breakdown to the Ask Sourcebot message details, showing what share of the input tokens were served from the model provider's prompt cache. [#1278](https://github.com/sourcebot-dev/sourcebot/pull/1278)
- Added `isLanguageModelConfigured` to the service ping, indicating whether at least one language model is configured. [#1296](https://github.com/sourcebot-dev/sourcebot/pull/1296)

### Changed
- Anthropic thinking mode (adaptive vs. extended) is now resolved from the model's capabilities via the Anthropic Models API instead of a hardcoded model list. [#1294](https://github.com/sourcebot-dev/sourcebot/pull/1294)
Expand Down
2 changes: 2 additions & 0 deletions docs/docs/misc/service-ping.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The data contained within the Service Ping is limited to:
| `mauCount` | `integer` | Monthly active users. |
| `deploymentType` | `string` | Deployment flavor (e.g. `docker`, `helm`). |
| `isTelemetryEnabled` | `boolean` | Whether anonymous product telemetry is enabled. |
| `isLanguageModelConfigured` | `boolean` | Whether at least one language model is configured. |
| `activationCode` | `string` | Activation code, if your instance has one bound. |


Expand Down Expand Up @@ -57,6 +58,7 @@ body: {
"mauCount": 1,
"deploymentType": "other",
"isTelemetryEnabled": true,
"isLanguageModelConfigured": true,
"activationCode": "sb_act_3a925f51...."
}
```
10 changes: 10 additions & 0 deletions packages/web/src/features/billing/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ This applies to:
- Adding, removing, or renaming fields on any `*RequestSchema` / `*ResponseSchema`.
- Changing a field's type, nullability, or validation (e.g. `.optional()`, `.nullable()`, `.datetime()`).
- Adding new route schemas.

## Keeping the Service Ping docs in sync

Whenever you change the `servicePingRequestSchema` (the `/ping` request payload) in `types.ts`, you MUST also update the user-facing Service Ping documentation:

```
docs/docs/misc/service-ping.mdx
```
Comment thread
brendan-kellam marked this conversation as resolved.

This includes updating the field reference table and the example payload to reflect any added, removed, or renamed fields.
4 changes: 4 additions & 0 deletions packages/web/src/features/billing/servicePing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createLogger, decryptActivationCode, env, SOURCEBOT_VERSION } from "@so
import { client } from "./client";
import { ServicePingRequest } from "./types";
import { ServiceErrorException } from "@/lib/serviceError";
import { getConfiguredLanguageModels } from "@/features/chat/utils.server";

const logger = createLogger('service-ping');

Expand Down Expand Up @@ -65,6 +66,8 @@ export const syncWithLighthouse = async (orgId: number) => {
? decryptActivationCode(license.activationCode)
: undefined;

const isLanguageModelConfigured = (await getConfiguredLanguageModels()).length > 0;

const payload: ServicePingRequest = {
installId: env.SOURCEBOT_INSTALL_ID,
version: SOURCEBOT_VERSION,
Expand All @@ -76,6 +79,7 @@ export const syncWithLighthouse = async (orgId: number) => {
mauCount,
deploymentType: inferDeploymentType(),
isTelemetryEnabled: env.SOURCEBOT_TELEMETRY_DISABLED === 'false',
isLanguageModelConfigured,
...(activationCode && { activationCode }),
};

Expand Down
1 change: 1 addition & 0 deletions packages/web/src/features/billing/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const servicePingRequestSchema = z.object({
mauCount: z.number().int().nonnegative(),
deploymentType: z.string(),
isTelemetryEnabled: z.boolean(),
isLanguageModelConfigured: z.boolean(),
activationCode: z.string().optional(),
});
export type ServicePingRequest = z.infer<typeof servicePingRequestSchema>;
Expand Down
Loading