toeverything/AFFiNE · error · CopilotPromptNotFound
copilot_prompt_not_found
copilot_prompt_not_found
Error message
Copilot prompt ${name} not found. What it means
toConversationMetaState rehydrates a stored copilot session and throws CopilotPromptNotFound if the promptName persisted with the session no longer resolves, e.g. the prompt was deleted after the session was created.
Solutions
- Confirm the prompt name exists via the prompt list API before creating the session.
- Fix the prompt name spelling or select one of the built-in prompts.
- If the prompt was deleted, recreate it or choose another prompt.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/backend/server/src/plugins/copilot/session.ts:219 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of toeverything/AFFiNE@2af30773ae (2026-08-18).
Data as JSON: /api/errors/b9834f52a537aace.
Report an issue: GitHub.
Appendix: source
Thrown at packages/backend/server/src/plugins/copilot/session.ts:179
private async toConversationState(
session: StoredConversation
): Promise<ConversationState> {
const { conversation, prompt } =
await this.toConversationMetaState(session);
return {
conversation,
turns: session.turns,
focus: session.focus,
prompt,
};
}
private async toConversationMetaState(
session: StoredConversation | StoredConversationMeta
): Promise<ConversationMetaState> {
const prompt = await this.prompts.get(session.promptName);
if (!prompt) throw new CopilotPromptNotFound({ name: session.promptName });
return {
conversation: session.conversation,
focus: session.focus,
prompt,
};
}
async getState(
sessionId: string,
userId: string,
workspaceId: string,
personal?: boolean
): Promise<ConversationState | undefined> {
const session = await this.store.get(
sessionId,
userId,
workspaceId,View on GitHub (pinned to 2af30773ae)