fix: stabilize docs and tests after system event timestamps
This commit is contained in:
@@ -118,12 +118,12 @@ Moonshot uses OpenAI-compatible endpoints, so configure it as a custom provider:
|
|||||||
- Auth: `MOONSHOT_API_KEY`
|
- Auth: `MOONSHOT_API_KEY`
|
||||||
- Example model: `moonshot/kimi-k2-0905-preview`
|
- Example model: `moonshot/kimi-k2-0905-preview`
|
||||||
- Kimi K2 model IDs:
|
- Kimi K2 model IDs:
|
||||||
<!-- moonshot-kimi-k2-model-refs:start -->
|
{/* moonshot-kimi-k2-model-refs:start */}
|
||||||
- `moonshot/kimi-k2-0905-preview`
|
- `moonshot/kimi-k2-0905-preview`
|
||||||
- `moonshot/kimi-k2-turbo-preview`
|
- `moonshot/kimi-k2-turbo-preview`
|
||||||
- `moonshot/kimi-k2-thinking`
|
- `moonshot/kimi-k2-thinking`
|
||||||
- `moonshot/kimi-k2-thinking-turbo`
|
- `moonshot/kimi-k2-thinking-turbo`
|
||||||
<!-- moonshot-kimi-k2-model-refs:end -->
|
{/* moonshot-kimi-k2-model-refs:end */}
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
agents: {
|
agents: {
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ Moonshot provides the Kimi API with OpenAI-compatible endpoints. Configure the
|
|||||||
provider and set the default model to `moonshot/kimi-k2-0905-preview`.
|
provider and set the default model to `moonshot/kimi-k2-0905-preview`.
|
||||||
|
|
||||||
Current Kimi K2 model IDs:
|
Current Kimi K2 model IDs:
|
||||||
<!-- moonshot-kimi-k2-ids:start -->
|
{/* moonshot-kimi-k2-ids:start */}
|
||||||
- `kimi-k2-0905-preview`
|
- `kimi-k2-0905-preview`
|
||||||
- `kimi-k2-turbo-preview`
|
- `kimi-k2-turbo-preview`
|
||||||
- `kimi-k2-thinking`
|
- `kimi-k2-thinking`
|
||||||
- `kimi-k2-thinking-turbo`
|
- `kimi-k2-thinking-turbo`
|
||||||
<!-- moonshot-kimi-k2-ids:end -->
|
{/* moonshot-kimi-k2-ids:end */}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
clawdbot onboard --auth-choice moonshot-api-key
|
clawdbot onboard --auth-choice moonshot-api-key
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ describe("prependSystemEvents", () => {
|
|||||||
second: "2-digit",
|
second: "2-digit",
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toContain(
|
expect(result).toContain(`System: [${expectedTimestamp}] Model switched.`);
|
||||||
`System: [${expectedTimestamp}] Model switched.`,
|
|
||||||
);
|
|
||||||
|
|
||||||
resetSystemEventsForTest();
|
resetSystemEventsForTest();
|
||||||
vi.useRealTimers();
|
vi.useRealTimers();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ beforeEach(() => {
|
|||||||
describe("discord native commands", () => {
|
describe("discord native commands", () => {
|
||||||
it(
|
it(
|
||||||
"streams tool results for native slash commands",
|
"streams tool results for native slash commands",
|
||||||
{ timeout: 10_000 },
|
{ timeout: 30_000 },
|
||||||
async () => {
|
async () => {
|
||||||
const { ChannelType } = await import("@buape/carbon");
|
const { ChannelType } = await import("@buape/carbon");
|
||||||
const { createDiscordNativeCommand } = await import("./monitor.js");
|
const { createDiscordNativeCommand } = await import("./monitor.js");
|
||||||
|
|||||||
@@ -179,7 +179,9 @@ export function registerDiscordListener(
|
|||||||
listeners: Array<object>,
|
listeners: Array<object>,
|
||||||
listener: object,
|
listener: object,
|
||||||
) {
|
) {
|
||||||
if (listeners.some((existing) => existing.constructor === listener.constructor)) {
|
if (
|
||||||
|
listeners.some((existing) => existing.constructor === listener.constructor)
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
listeners.push(listener);
|
listeners.push(listener);
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ describe("system events (session routing)", () => {
|
|||||||
isNewSession: false,
|
isNewSession: false,
|
||||||
prefixedBodyBase: "hi",
|
prefixedBodyBase: "hi",
|
||||||
});
|
});
|
||||||
expect(discord).toBe("System: Discord reaction added: ✅\n\nhi");
|
expect(discord).toMatch(
|
||||||
|
/^System: \[[^\]]+\] Discord reaction added: ✅\n\nhi$/,
|
||||||
|
);
|
||||||
expect(peekSystemEvents("discord:group:123")).toEqual([]);
|
expect(peekSystemEvents("discord:group:123")).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user