Skip to content
Open
2 changes: 1 addition & 1 deletion docs/user/providers-muse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Run [Muse Code](https://dev.meta.ai/docs/muse-code) on your T3 Code server. Muse
1. Install Muse Code on the server machine and run `muse login` as the user running T3 Code.
2. Open **Settings → Providers**, select the environment, enable **Muse Code** (set **Binary path** if not on `PATH`), and refresh provider status.

> Note: Provider status does not verify login—if you are signed out, turns fail until you run `muse login` on the host.
> Note: Provider status shows when you are signed out if your Muse Code version reports its login; with older versions, turns fail until you run `muse login` on the host.

- **API key**: T3 Code ignores inherited server `META_API_KEY`. To bill an instance via API key instead of `muse login`, add `META_API_KEY` in that instance's **Environment** settings (overrides the saved login).
- **Multiple instances**: Instances on the same host share `muse login` unless given their own `META_API_KEY`.
Expand Down
1 change: 1 addition & 0 deletions packages/provider-core/src/server/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { ProviderMaintenanceCapabilities } from "./maintenance.ts";
export type ProviderUsageLimitsReport = ProviderUsageLimitsUpdate & {
readonly checkedAt: string;
readonly authLabel?: string;
readonly credentialFingerprint?: string;
/** A full reading replaces sparse windows and clears a previous probe failure. */
readonly complete?: boolean;
};
Expand Down
10 changes: 10 additions & 0 deletions packages/provider-core/src/server/usageLimits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ describe("applyUsageLimitsUpdate", () => {
zeroSpendCap: true,
});
});

it("keeps the credential fingerprint when a streamed window update changes usage", () => {
const next = applyUsageLimitsUpdate({
previous: { ...published, credentialFingerprint: "account:abc" },
checkedAt: "2026-09-03T12:00:05.000Z",
update: { windows: [{ ...session, usedPercent: 55 }] },
});

expect(next?.credentialFingerprint).toBe("account:abc");
});
});

describe("resolveUsageLimitsAfterProbe", () => {
Expand Down
10 changes: 9 additions & 1 deletion packages/provider-core/src/server/usageLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ function sortWindows(
export function makeUsageLimits(input: {
readonly checkedAt: string;
readonly windows: Iterable<ServerProviderUsageWindow>;
readonly credentialFingerprint?: string;
}): ServerProviderUsageLimits {
return { checkedAt: input.checkedAt, windows: sortWindows(input.windows) };
return {
checkedAt: input.checkedAt,
windows: sortWindows(input.windows),
...(input.credentialFingerprint ? { credentialFingerprint: input.credentialFingerprint } : {}),
};
}

export function makeUnavailableUsageLimits(input: {
Expand Down Expand Up @@ -87,6 +92,9 @@ export function applyUsageLimitsUpdate(input: {
...makeUsageLimits({ checkedAt: input.checkedAt, windows: merged.values() }),
...(previous?.resetCredits !== undefined ? { resetCredits: previous.resetCredits } : {}),
...(previous?.zeroSpendCap ? { zeroSpendCap: true } : {}),
...(previous?.credentialFingerprint
? { credentialFingerprint: previous.credentialFingerprint }
: {}),
...(unavailable !== undefined ? { unavailable } : {}),
};
}
Expand Down
Loading
Loading