sbkl
sbkl2w ago

File <fileId> not found when incrementing refcount

I have a document to markdown agent that store a file for later converting it to markdown: I store and register the file with the documentToMarkdownAgent like so:
const { file } = await storeFile(
ctx,
components.documentToMarkdownAgent,
new Blob([args.bytes], { type: args.mimeType }),
{ filename: args.filename, sha256: args.sha256 }
);
const { file } = await storeFile(
ctx,
components.documentToMarkdownAgent,
new Blob([args.bytes], { type: args.mimeType }),
{ filename: args.filename, sha256: args.sha256 }
);
Later, I want to reference the fileId with the summary agent when using it to summarise the document
const { messageId: summaryMessageId } = await summaryAgent.saveMessage(
ctx,
{
threadId: summaryThreadId,
userId,
message: {
role: "user",
content: [
{
type: "text",
text: `Summarise the content of the context provided in a concise manner:
<context>
${markdownText}
</context>`,
},
],
},
metadata: { fileIds: [fileId] },
}
);
const { messageId: summaryMessageId } = await summaryAgent.saveMessage(
ctx,
{
threadId: summaryThreadId,
userId,
message: {
role: "user",
content: [
{
type: "text",
text: `Summarise the content of the context provided in a concise manner:
<context>
${markdownText}
</context>`,
},
],
},
metadata: { fileIds: [fileId] },
}
);
This step triggers the error: File <fileId> not found when incrementing refcount. When checking the files table under the documentToMarkdownAgent in the dashboard, I can see the file and the right id that is claimed not to be found. I can also see the refCount being updated when referencing it with the documentToMarkdownAgent. Am I doing anything wrong here?
1 Reply
Convex Bot
Convex Bot2w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!

Did you find this page helpful?