Clarify empty OpenClaw artifact runs

This commit is contained in:
Haitao Pan 2026-05-12 15:12:31 +08:00
parent 5c686f95b2
commit 29e09701b8
5 changed files with 11 additions and 7 deletions

View File

@ -140,8 +140,9 @@ Export response payload:
Files at or below `maxInlineBytes` also include `encoding: "base64"` and `content`.
When `artifactScope` is omitted, export/list defaults to the current task scope
derived from `sessionKey/runId`. If that scope has no files, export/list returns
an empty artifact list. The plugin does not scan the workspace root and does not
borrow artifacts from earlier task scopes.
an empty artifact list with the manifest text `No artifacts found for this task
run.` The plugin does not scan the workspace root and does not borrow artifacts
from earlier task scopes.
Each exported artifact includes `artifactRef`, a plugin-signed reference over
the issued session/run scope, artifact scope, path, size, and SHA-256 digest. `read` accepts

View File

@ -87,7 +87,7 @@ export async function exportXWorkmateArtifacts(input) {
})
: [];
if (!scopePrepared) {
warnings.push("artifact scope is not prepared");
warnings.push("artifact scope is not prepared for this task run");
}
candidates.sort((left, right) => {
if (right.mtimeMs !== left.mtimeMs) {
@ -265,7 +265,7 @@ export function formatArtifactManifestMarkdown(input) {
"",
];
if (input.artifacts.length === 0) {
lines.push("No artifacts found.");
lines.push("No artifacts found for this task run.");
}
else {
lines.push("| File | Type | Size | SHA-256 | Inline |");

View File

@ -114,7 +114,8 @@ describe("plugin registration", () => {
});
expect(unprepared.ok).toBe(true);
expect(unprepared.payload?.artifacts).toEqual([]);
expect(unprepared.payload?.warnings).toEqual(["artifact scope is not prepared"]);
expect(unprepared.payload?.warnings).toEqual(["artifact scope is not prepared for this task run"]);
expect(unprepared.payload?.manifestMarkdown).toContain("No artifacts found for this task run.");
});
it("does not invent default session or run ids for the optional agent tool", async () => {

View File

@ -194,6 +194,8 @@ describe("exportXWorkmateArtifacts", () => {
expect(result.scopeKind).toBe("task");
expect(result.artifacts).toEqual([]);
expect(result.manifestMarkdown).toContain("No artifacts found for this task run.");
expect(result.manifestMarkdown).toContain("Artifact scope: `tasks/thread-main/turn-1`");
});
it("rejects scoped exports that do not match the requested session/run", async () => {

View File

@ -168,7 +168,7 @@ export async function exportXWorkmateArtifacts(input: ExportInput): Promise<XWor
})
: [];
if (!scopePrepared) {
warnings.push("artifact scope is not prepared");
warnings.push("artifact scope is not prepared for this task run");
}
candidates.sort((left, right) => {
@ -366,7 +366,7 @@ export function formatArtifactManifestMarkdown(input: {
"",
];
if (input.artifacts.length === 0) {
lines.push("No artifacts found.");
lines.push("No artifacts found for this task run.");
} else {
lines.push("| File | Type | Size | SHA-256 | Inline |");
lines.push("| --- | --- | ---: | --- | --- |");