fix(cli): t3 triage reports the server's version, not its own, as the user's build (#19359)

Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Theo BrowneandClaude Opus 5.5 authored and GitHub committed 2026-10-14 02:57:52 -07:00
1 parent 0ae1091d01
commit ffceb61fcb
7 files changed
+168 -35

No files matched your search

+9
View File
@@ -5,10 +5,12 @@ import * as Option from "effect/Option";
import * as Schema from "effect/Schema";
import { writeFileStringAtomically } from "@t3tools/shared/atomicWrite";
import packageJson from "../package.json" with { type: "json" };
import type * as ServerConfig from "./config.ts";
import { formatHostForUrl, isWildcardHost } from "./startupAccess.ts";
export const PersistedServerRuntimeState = Schema.Struct({
// Schema version of this file, not the server build. See `serverVersion`.
version: Schema.Literal(1),
pid: Schema.Int,
ownerId: Schema.optional(Schema.String),
@@ -25,6 +27,12 @@ export const PersistedServerRuntimeState = Schema.Struct({
* the difference between "restart the service" and "stop your terminal".
*/
serviceManaged: Schema.optional(Schema.Boolean),
/**
* The server build that wrote this record. `t3 triage` reports it because
* the CLI that runs triage can be a different build. Missing on records
* written by older servers.
*/
serverVersion: Schema.optional(Schema.String),
});
export type PersistedServerRuntimeState = typeof PersistedServerRuntimeState.Type;
@@ -68,6 +76,7 @@ export const makePersistedServerRuntimeState = (input: {
...(input.config.devUrl ? { devUrl: input.config.devUrl.toString() } : {}),
startedAt: DateTime.formatIso(now),
...(input.serviceManaged ? { serviceManaged: true } : {}),
serverVersion: packageJson.version,
}));
export const persistServerRuntimeState = (input: {