Skip to content

Commit e540e4a

Browse files
saphidclaude
authored andcommitted
fix(muse): the thread error banner no longer shows unredacted failure text
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 61c3794 commit e540e4a

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎packages/provider-muse/src/server/adapter.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,12 +767,20 @@ describe("MuseAdapterV2", () => {
767767
yield* fake.emit("turn/completed", {
768768
turnId: nativeId,
769769
terminal: "failed",
770-
error: { message: "Provider rejected this turn" },
770+
error: { message: "Provider rejected this turn: api_key=abc123" },
771771
});
772772
const terminal = yield* harness.takeEvent("turn.terminal");
773773
assert.strictEqual(terminal.status, "failed");
774774
assert.strictEqual(terminal.threadDisposition, "reusable");
775-
assert.isNotNull(terminal.failure);
775+
assert.strictEqual(
776+
terminal.failure?.message,
777+
"Provider rejected this turn: api_key=[REDACTED]",
778+
);
779+
assert.strictEqual(
780+
harness.allEvents.findLast((event) => event.type === "provider_session.updated")
781+
?.providerSession.lastError,
782+
terminal.failure?.message,
783+
);
776784
assert.isTrue(
777785
harness.allEvents.some(
778786
(event) =>

‎packages/provider-muse/src/server/adapter.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,14 @@ export const makeMuseAdapterV2 = Effect.fn("makeMuseAdapterV2")(function* (
395395
status: OrchestrationV2ProviderSession["status"],
396396
lastError: string | null = null,
397397
) {
398-
session = { ...session, status, lastError, updatedAt: yield* DateTime.now };
398+
session = {
399+
...session,
400+
status,
401+
// lastError is the thread banner, so it gets the failure item's bounded, redacted text.
402+
lastError:
403+
lastError === null ? null : makeProviderFailure({ message: lastError }).message,
404+
updatedAt: yield* DateTime.now,
405+
};
399406
yield* emit({
400407
type: "provider_session.updated",
401408
driver: MUSE_PROVIDER,

0 commit comments

Comments
 (0)