Compare commits
1 Commits
main
...
fix/sessio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21ed547bfc |
@ -6,6 +6,7 @@ Docs: https://docs.clawd.bot
|
||||
|
||||
### Fixes
|
||||
- Control UI: ignore bootstrap identity placeholder text for avatar values and fall back to the default avatar. https://docs.clawd.bot/cli/agents https://docs.clawd.bot/web/control-ui
|
||||
- Hooks: suppress session-memory confirmation output. (#1464) Thanks @alfranli123.
|
||||
|
||||
## 2026.1.21
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ When you run `/new` to start a fresh session:
|
||||
2. **Extracts conversation** - Reads the last 15 lines of conversation from the session
|
||||
3. **Generates descriptive slug** - Uses LLM to create a meaningful filename slug based on conversation content
|
||||
4. **Saves to memory** - Creates a new file at `<workspace>/memory/YYYY-MM-DD-slug.md`
|
||||
5. **Sends confirmation** - Notifies you with the file path
|
||||
5. **Logs completion** - Writes the file path to logs (no user-visible confirmation)
|
||||
|
||||
## Output Format
|
||||
|
||||
|
||||
43
src/hooks/bundled/session-memory/handler.test.ts
Normal file
43
src/hooks/bundled/session-memory/handler.test.ts
Normal file
@ -0,0 +1,43 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import handler from "./handler.js";
|
||||
import { createHookEvent } from "../../hooks.js";
|
||||
import type { ClawdbotConfig } from "../../../config/config.js";
|
||||
import { makeTempWorkspace } from "../../../test-helpers/workspace.js";
|
||||
|
||||
describe("session-memory hook", () => {
|
||||
it("writes a memory entry without queuing a user confirmation", async () => {
|
||||
const workspaceDir = await makeTempWorkspace("clawdbot-session-memory-");
|
||||
const cfg: ClawdbotConfig = {
|
||||
agents: {
|
||||
defaults: {
|
||||
workspace: workspaceDir,
|
||||
},
|
||||
},
|
||||
};
|
||||
const context: Record<string, unknown> = {
|
||||
cfg,
|
||||
sessionEntry: {
|
||||
sessionId: "session-123",
|
||||
sessionFile: "",
|
||||
},
|
||||
commandSource: "test",
|
||||
};
|
||||
|
||||
const event = createHookEvent("command", "new", "agent:main:main", context);
|
||||
await handler(event);
|
||||
|
||||
expect(event.messages).toEqual([]);
|
||||
|
||||
const memoryDir = path.join(workspaceDir, "memory");
|
||||
const files = await fs.readdir(memoryDir);
|
||||
expect(files).toHaveLength(1);
|
||||
|
||||
const entry = await fs.readFile(path.join(memoryDir, files[0] ?? ""), "utf-8");
|
||||
expect(entry).toContain("Session Key");
|
||||
expect(entry).toContain("session-123");
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user