Skip to content

Commit e3ebb1e

Browse files
t3dotggclaude
andcommitted
fix(server): Muse recorder runs T3_MUSE_BIN and decodes split UTF-8 safely
Also stops exporting an unused replay constant (knip). Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e325228 commit e3ebb1e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎apps/server/scripts/record-muse-msp-replay-fixture.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ function makeRecordingCreateHost(
143143
entries.push({ type, ...(label === undefined ? {} : { label }), frame });
144144
};
145145
record("expect_outbound", { type: "host_start", args });
146-
const child = NodeChildProcess.spawn(options.binaryPath, args, {
146+
// The binary named by T3_MUSE_BIN, so the recorded version matches what ran.
147+
const child = NodeChildProcess.spawn(museBinary, args, {
147148
cwd: options.cwd,
148149
env: options.environment ?? makeMuseEnvironment(),
149150
stdio: ["pipe", "pipe", "inherit"],
@@ -153,7 +154,8 @@ function makeRecordingCreateHost(
153154
);
154155
async function* incoming() {
155156
let buffer = "";
156-
for await (const chunk of child.stdout) {
157+
// utf8 decoding keeps a character split across chunks intact.
158+
for await (const chunk of child.stdout.setEncoding("utf8")) {
157159
buffer += String(chunk);
158160
const lines = buffer.split("\n");
159161
buffer = lines.pop() ?? "";

‎apps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { makeMuseAdapterV2 } from "./MuseAdapterV2.ts";
4545

4646
export const MUSE_PROVIDER_KIND = "muse";
4747
export const MUSE_MSP_REPLAY_PROTOCOL = "muse.msp-jsonl";
48-
export const MUSE_REPLAY_ANY = "<any>";
48+
const MUSE_REPLAY_ANY = "<any>";
4949

5050
const MuseReplayTranscript = Schema.Struct({
5151
provider: Schema.Literal(MUSE_PROVIDER_KIND),

0 commit comments

Comments
 (0)