forked from EduCraft/curriculum-project-hub
fix(hub): agent 会话记忆在配置变更/发版后丢失 + Feishu thread 400 (#19)
Co-authored-by: Hong Jiarong <me@jrhim.com> Co-committed-by: Hong Jiarong <me@jrhim.com>
This commit is contained in:
@@ -43,7 +43,7 @@ describe("Organization Agent configuration management", () => {
|
||||
provider: "openrouter",
|
||||
roleId: "draft",
|
||||
model: "anthropic/claude-sonnet-5",
|
||||
metadata: {},
|
||||
metadata: { claudeSessionId: "sdk-session-old", userResumable: true },
|
||||
},
|
||||
});
|
||||
await configuration.setRoleSkills({
|
||||
@@ -59,10 +59,12 @@ describe("Organization Agent configuration management", () => {
|
||||
expect(role).toMatchObject({ label: "课程草稿", systemPrompt: "write carefully" });
|
||||
expect(role.tools).toEqual(["read_file", "write_file", "cph_build"]);
|
||||
expect(role.skillBindings.map((binding) => binding.skill.name)).toEqual(["outline", "typst"]);
|
||||
// Execution-surface change invalidates the provider session cursor but
|
||||
// keeps the Hub session alive so its transcript stays reachable.
|
||||
await expect(prisma.agentSession.findUniqueOrThrow({ where: { id: "session-old-role-config" } }))
|
||||
.resolves.toMatchObject({
|
||||
archivedAt: expect.any(Date),
|
||||
metadata: expect.objectContaining({ userResumable: false }),
|
||||
archivedAt: null,
|
||||
metadata: expect.objectContaining({ userResumable: false, claudeSessionId: undefined }),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user