Let a user stop a bot, and say the app is still alpha

The thinking row and the header menu both carry Stop while a bot has work
open for the user anywhere: every pending or processing job of that bot in
their conversations is failed as stopped, its task closed, a Stopped step
recorded and one closing message posted per session, so the thread stops
waiting and the bot goes idle. The handler running the job is aborted from
this process through a registry, so a job stuck waiting on a model stops at
once instead of on its next heartbeat, and a late face change after the
abort is dropped.

The release stage is now said in the app too: Settings > General reports
"Cobble v0.1.5 (alpha)" next to development, and the README and RELEASING.md
say what alpha means for installs.
This commit is contained in:
2026-10-23 10:19:41 +01:00
parent 5beb5f3de4
commit fcad4b49d6
30 changed files with 1279 additions and 57 deletions
@@ -1,5 +1,6 @@
import Span from "@moduletrace/twui/layout/Span";
import type { RunningVersion } from "@/src/utils/running-version";
import versionLabel from "../(utils)/version-label";
type Props = {
running?: RunningVersion | null;
@@ -7,21 +8,14 @@ type Props = {
/**
* The release this server runs, in words: settings are where someone
* checks whether an update landed. A development server says so beside
* its version, so the two are never mistaken.
* checks whether an update landed. The stage and, on a development server,
* that it is one ride along, so neither what it runs nor what it is can be
* mistaken.
*/
export default function VersionLine({ running }: Props) {
if (!running) return null;
const label = versionLabel({ running });
const version = running.version
? `Cobble ${running.version}`
: "Cobble";
if (!label) return null;
return (
<Span className="text-sm leading-5 text-ink">
{running.mode == "development"
? `${version} (development)`
: version}
</Span>
);
return <Span className="text-sm leading-5 text-ink">{label}</Span>;
}
@@ -0,0 +1,30 @@
import { describe, expect, test } from "bun:test";
import versionLabel from "./version-label";
describe("versionLabel", () => {
test("a release names its version and that it is alpha", () => {
expect(
versionLabel({
running: { version: "v0.1.5", mode: "production" },
}),
).toBe("Cobble v0.1.5 (alpha)");
});
test("a development server says so beside the stage", () => {
expect(
versionLabel({
running: { version: "0.1.5", mode: "development" },
}),
).toBe("Cobble 0.1.5 (development, alpha)");
});
test("a server with no usable version still names the stage", () => {
expect(
versionLabel({ running: { version: null, mode: "production" } }),
).toBe("Cobble (alpha)");
});
test("no running version says nothing at all", () => {
expect(versionLabel({ running: null })).toBeNull();
});
});
@@ -0,0 +1,27 @@
import type { RunningVersion } from "@/src/utils/running-version";
/**
* The stage every release is published as. Cobble is still alpha: the
* schema, the settings and the screens change between releases, so the app
* says so wherever it names its version, not only in the README.
*/
export const ReleaseStage = "alpha";
type Params = {
running?: RunningVersion | null;
};
/**
* The running release in words, for the General settings page: "Cobble
* v0.1.5 (alpha)", and a development server adds that it is one, so a dev
* build is never mistaken for a release.
*/
export default function versionLabel({ running }: Params): string | null {
if (!running) return null;
const parts = [running.mode == "development" ? "development" : "", ReleaseStage].filter(
(part) => part.length > 0,
);
return `${running.version ? `Cobble ${running.version}` : "Cobble"} (${parts.join(", ")})`;
}