Skip to content

Commit de26e57

Browse files
feat(web): add isLanguageModelConfigured to service ping
Fixes SOU-1278 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 279bbb8 commit de26e57

4 files changed

Lines changed: 17 additions & 0 deletions

File tree

docs/docs/misc/service-ping.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The data contained within the Service Ping is limited to:
2323
| `mauCount` | `integer` | Monthly active users. |
2424
| `deploymentType` | `string` | Deployment flavor (e.g. `docker`, `helm`). |
2525
| `isTelemetryEnabled` | `boolean` | Whether anonymous product telemetry is enabled. |
26+
| `isLanguageModelConfigured` | `boolean` | Whether at least one language model is configured. |
2627
| `activationCode` | `string` | Activation code, if your instance has one bound. |
2728

2829

@@ -57,6 +58,7 @@ body: {
5758
"mauCount": 1,
5859
"deploymentType": "other",
5960
"isTelemetryEnabled": true,
61+
"isLanguageModelConfigured": true,
6062
"activationCode": "sb_act_3a925f51...."
6163
}
6264
```

packages/web/src/features/billing/CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ This applies to:
1616
- Adding, removing, or renaming fields on any `*RequestSchema` / `*ResponseSchema`.
1717
- Changing a field's type, nullability, or validation (e.g. `.optional()`, `.nullable()`, `.datetime()`).
1818
- Adding new route schemas.
19+
20+
## Keeping the Service Ping docs in sync
21+
22+
Whenever you change the `servicePingRequestSchema` (the `/ping` request payload) in `types.ts`, you MUST also update the user-facing Service Ping documentation:
23+
24+
```
25+
docs/docs/misc/service-ping.mdx
26+
```
27+
28+
This includes updating the field reference table and the example payload to reflect any added, removed, or renamed fields.

packages/web/src/features/billing/servicePing.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { createLogger, decryptActivationCode, env, SOURCEBOT_VERSION } from "@so
66
import { client } from "./client";
77
import { ServicePingRequest } from "./types";
88
import { ServiceErrorException } from "@/lib/serviceError";
9+
import { getConfiguredLanguageModels } from "@/features/chat/utils.server";
910

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

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

69+
const isLanguageModelConfigured = (await getConfiguredLanguageModels()).length > 0;
70+
6871
const payload: ServicePingRequest = {
6972
installId: env.SOURCEBOT_INSTALL_ID,
7073
version: SOURCEBOT_VERSION,
@@ -76,6 +79,7 @@ export const syncWithLighthouse = async (orgId: number) => {
7679
mauCount,
7780
deploymentType: inferDeploymentType(),
7881
isTelemetryEnabled: env.SOURCEBOT_TELEMETRY_DISABLED === 'false',
82+
isLanguageModelConfigured,
7983
...(activationCode && { activationCode }),
8084
};
8185

packages/web/src/features/billing/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const servicePingRequestSchema = z.object({
1111
mauCount: z.number().int().nonnegative(),
1212
deploymentType: z.string(),
1313
isTelemetryEnabled: z.boolean(),
14+
isLanguageModelConfigured: z.boolean(),
1415
activationCode: z.string().optional(),
1516
});
1617
export type ServicePingRequest = z.infer<typeof servicePingRequestSchema>;

0 commit comments

Comments
 (0)