Clarify that IM file delivery requires dsh_im_return_file (4.9.1-ops.22).

Strengthen tool and system-prompt copy so models do not treat a pasted workspace path as delivery.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-05 19:25:07 +08:00
parent a92080e490
commit 385bc1edf5
4 changed files with 16 additions and 6 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "dsh-im-ops",
"version": "4.9.1-ops.21",
"version": "4.9.1-ops.22",
"description": "Ops fork of dsh-im (all channels kept). Based on @xmanrui/dsh-im@4.9.1 — access/session policies owned here.",
"keywords": [
"deepseek-harness",

View file

@ -576,7 +576,11 @@ export function createOutboundArtifactTool({ registry = outboundArtifactRegistry
};
const definition = Object.freeze({
name: OUTBOUND_ARTIFACT_TOOL,
description: 'Send a readable file or generated image to the user through the current conversation. Existing and newly created files are both valid.',
description: [
'Deliver a readable file or generated image to the user in this IM chat as a real attachment.',
'Call this after the file exists on disk. Pasting a workspace path in the reply text does not send the file.',
'Existing and newly created files are both valid.',
].join(' '),
parameters: {
type: 'object',
additionalProperties: false,
@ -654,7 +658,11 @@ export function installOutboundArtifactTool(ctx, { registry = outboundArtifactRe
ctx.systemPrompt.section({
name: 'dsh-im:return-file',
order: 115,
text: `When the user asks to receive a file or generated image, call ${OUTBOUND_ARTIFACT_TOOL} with its path. Existing files can be sent directly; do not recreate or rename a file solely for delivery.`,
text: [
`When the user asks to receive a file or generated image in this IM chat, you MUST call ${OUTBOUND_ARTIFACT_TOOL} with the file path so the channel can attach it.`,
'Writing or pasting a local/workspace path in the reply text does not deliver the file to the user.',
'Create or locate the file first, then call the tool. Do not recreate or rename a file solely for delivery.',
].join(' '),
});
return true;
}

View file

@ -381,7 +381,9 @@ test('Host installer always exposes the tool and explicitly permits existing fil
assert.equal(installed, true);
assert.equal(definition.name, OUTBOUND_ARTIFACT_TOOL);
assert.match(definition.description, /Existing and newly created files are both valid/);
assert.match(section.text, /Existing files can be sent directly/);
assert.match(definition.description, /Pasting a workspace path in the reply text does not send the file/);
assert.match(section.text, /MUST call dsh_im_return_file/);
assert.match(section.text, /does not deliver the file/);
assert.equal(typeof listeners.get('tools/result'), 'function');
assert.equal(typeof listeners.get('session/event'), 'function');
assert.equal(typeof listeners.get('session/disposed'), 'function');