refactor: centralize sandbox runtime label

This commit is contained in:
Peter Steinberger
2026-01-21 09:07:21 +00:00
parent 1e10dc1d3b
commit 6c69ea2c91
2 changed files with 56 additions and 35 deletions

View File

@@ -74,6 +74,25 @@ describe("buildStatusMessage", () => {
expect(normalized).toContain("Queue: collect");
});
it("uses per-agent sandbox config when config and session key are provided", () => {
const text = buildStatusMessage({
config: {
agents: {
list: [
{ id: "main", default: true },
{ id: "discord", sandbox: { mode: "all" } },
],
},
} as ClawdbotConfig,
agent: {},
sessionKey: "agent:discord:discord:channel:1456350065223270435",
sessionScope: "per-sender",
queue: { mode: "collect", depth: 0 },
});
expect(normalizeTestText(text)).toContain("Runtime: docker/all");
});
it("shows verbose/elevated labels only when enabled", () => {
const text = buildStatusMessage({
agent: { model: "anthropic/claude-opus-4-5" },