A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Keep the versions in the issue when the errors are too long
Fei24113330ba02639a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 3e003d94..ef97d162 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -30,6 +30,7 @@ All notable changes to DS Bot are listed here. The format follows [Keep a Change- Deleting a Bot or group chat also removes its scheduled tasks, including ones left on the Bot's earlier chat parts. Before, armed tasks stayed active and kept running the deleted Session; the archive that would have stopped them was refused and the failure was silent.- A long conversation's fresh part keeps the Bot's model and thinking level. Before, the new part fell back to the default model.- A provider adapter that cannot measure tokens no longer fails every turn. The context size is estimated instead, with one warning in the log.+- When the recent errors were too long for **Report on GitHub**, the new issue got no diagnostics at all. Now it keeps the versions, the system and the models, and only the errors go by the clipboard.- The memory panel's summary works on models that think by default. The call asks for the model's lowest thinking level, and when the answer is cut off at the output limit it is written once more with a larger budget instead of failing or being saved half-written.- A message sent to a group chat while a round is running joins that round before the next member speaks. Everyone still to speak sees it, and the members it is for answer it in the same round. Before, it waited for the whole round to end. A message with images or a referenced conversation still waits for its own round.diff --git a/ds-bot/client.js b/ds-bot/client.jsindex 6e6a2f55..a750541f 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -966,12 +966,17 @@ function failureLabel(code, message) {var URL_LIMIT = 7e3;var WHAT_MAX = 2e3;var PASTE_NOTE = "DS Bot copied the diagnostics to the clipboard. Paste them here.";+var REST_NOTE = "The recent errors do not fit in the link. DS Bot copied the diagnostics to the clipboard: paste them below this line.";function issueUrl(base, { what = "", diagnostics }) {const text = what.trim().slice(0, WHAT_MAX);const title = text.split("\n")[0].slice(0, 80);const build = (body) => `${base}?${new URLSearchParams({ template: "bug.yml", ...title ? { title } : {}, ...text ? { what: text } : {}, diagnostics: body })}`;const full2 = build(diagnostics);- return full2.length <= URL_LIMIT ? { url: full2, inline: true } : { url: build(PASTE_NOTE), inline: false };+ if (full2.length <= URL_LIMIT) return { url: full2, inline: true };+ const facts = build(`${diagnostics.split("\n\n")[0]}++${REST_NOTE}`);+ return { url: facts.length <= URL_LIMIT ? facts : build(PASTE_NOTE), inline: false };}// src/client/api.jsdiff --git a/ds-bot/src/client/diagnostics.js b/ds-bot/src/client/diagnostics.jsindex dd963358..ae38c4dc 100644--- a/ds-bot/src/client/diagnostics.js+++ b/ds-bot/src/client/diagnostics.js@@ -70,11 +70,16 @@ export function failureLabel(code, message) {const URL_LIMIT = 7000export const WHAT_MAX = 2000const PASTE_NOTE = 'DS Bot copied the diagnostics to the clipboard. Paste them here.'+const REST_NOTE = 'The recent errors do not fit in the link. DS Bot copied the diagnostics to the clipboard: paste them below this line.'export function issueUrl(base, { what = '', diagnostics }) {const text = what.trim().slice(0, WHAT_MAX)const title = text.split('\n')[0].slice(0, 80)const build = body => `${base}?${new URLSearchParams({ template: 'bug.yml', ...(title ? { title } : {}), ...(text ? { what: text } : {}), diagnostics: body })}`const full = build(diagnostics)- return full.length <= URL_LIMIT ? { url: full, inline: true } : { url: build(PASTE_NOTE), inline: false }+ if (full.length <= URL_LIMIT) return { url: full, inline: true }+ // The versions table leads the report and stays short; only the errors make it+ // long, and a report that lost the versions is hard to act on.+ const facts = build(`${diagnostics.split('\n\n')[0]}\n\n${REST_NOTE}`)+ return { url: facts.length <= URL_LIMIT ? facts : build(PASTE_NOTE), inline: false }}diff --git a/ds-bot/test/diagnostics.test.js b/ds-bot/test/diagnostics.test.jsindex bc6d8a47..17bfc5c4 100644--- a/ds-bot/test/diagnostics.test.js+++ b/ds-bot/test/diagnostics.test.js@@ -214,7 +214,7 @@ test('a failed group turn fails its waiter; a stopped one counts as no answer',assert.equal(value, null)})-test('issueUrl fills the issue form, and falls back to the clipboard when too long', async () => {+test('issueUrl fills the issue form, keeps the versions when the errors are too long, and falls back to the clipboard', async () => {const { issueUrl } = await import('../src/client/diagnostics.js')const base = 'https://github.com/Fei2411/DeepSeek-Bot/issues/new'const short = issueUrl(base, { what: 'Writer failed\nin the group', diagnostics: '| DS Bot | 0.1.0 |' })@@ -229,6 +229,14 @@ test('issueUrl fills the issue form, and falls back to the clipboard when too loassert.ok(long.url.length < 7000)assert.match(new URL(long.url).searchParams.get('diagnostics'), /clipboard/)assert.equal(new URL(long.url).searchParams.has('title'), false)+ const table = '| | |\n|---|---|\n| DS Bot | 0.1.2 |\n| DSH | 0.2.0 |'+ const errors = issueUrl(base, { what: 'Writer failed', diagnostics: `${table}\n\nRecent host errors:\n${'错误'.repeat(2000)}` })+ assert.equal(errors.inline, false)+ assert.ok(errors.url.length < 7000)+ const kept = new URL(errors.url).searchParams.get('diagnostics')+ assert.ok(kept.startsWith(`${table}\n\n`))+ assert.match(kept, /clipboard: paste them below this line/)+ assert.doesNotMatch(kept, /错误/)})test('a browser error is noted once, repeats are counted, and clear empties the list', async () => {