mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-18 20:11:40 +00:00
* fix(agents): keep truncation surrogate-safe * test(agents): tighten process label truncation coverage --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
26 lines
926 B
TypeScript
26 lines
926 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { listActiveProcessSessionReferences } from "./bash-process-references.js";
|
|
import { addSession, deleteSession } from "./bash-process-registry.js";
|
|
import { createProcessSessionFixture } from "./bash-process-registry.test-helpers.js";
|
|
|
|
describe("bash-process-references truncation", () => {
|
|
it("keeps scoped session labels valid when the limit bisects an emoji", () => {
|
|
const command = `${"a".repeat(136)}😀xyz`;
|
|
const session = createProcessSessionFixture({
|
|
id: "emoji-proc-scoped",
|
|
command,
|
|
backgrounded: true,
|
|
startedAt: 1,
|
|
});
|
|
session.scopeKey = "scope-a";
|
|
addSession(session);
|
|
|
|
try {
|
|
const [reference] = listActiveProcessSessionReferences({ scopeKey: "scope-a", now: 2 });
|
|
expect(reference?.name).toBe(`${"a".repeat(136)}...`);
|
|
} finally {
|
|
deleteSession("emoji-proc-scoped");
|
|
}
|
|
});
|
|
});
|