dsh-tg-bridge 1.41.0 → 1.41.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # CHANGELOG — DSH Telegram bridge
2
2
 
3
+ ## 1.41.1
4
+
5
+ - **A note cannot land in General while its turn is elsewhere.** `say.mjs
6
+ --chat <id>` without `--thread` meant thread 0, and thread 0 is a group's
7
+ General topic: a session that knew only the chat wrote its working notes there
8
+ while its card named another topic, and nothing said so. The live marker for
9
+ the folder completes the half a flag carries and prints `--thread missing:
10
+ using topic N of the turn running in this folder`; a caller that passes both
11
+ keeps its own topic, and no target at all is still a refusal.
12
+ - Reported from a real group. The markers and files on disk were consistent when
13
+ checked, so this closes the hole the symptom needs rather than claiming the
14
+ exact line that produced it.
15
+
3
16
  ## 1.41.0
4
17
 
5
18
  - **`/start` opens a five-step tour.** The command list answers "what is the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tg-bridge",
3
- "version": "1.41.0",
3
+ "version": "1.41.2",
4
4
  "description": "Drive DeepSeek Harness from Telegram: one project, model and session per forum topic",
5
5
  "type": "module",
6
6
  "main": "plugin-bridge.mjs",
package/say.mjs CHANGED
@@ -183,6 +183,15 @@ async function main() {
183
183
  threadId = active.threadId;
184
184
  }
185
185
  }
186
+ // `--chat` without `--thread` used to mean thread 0, and thread 0 is the
187
+ // group's General topic: a note written from a session that only knew the
188
+ // chat landed in "General" while it was talking about another topic's work.
189
+ // The live marker for this folder knows both halves, so it wins over half a
190
+ // flag — and says so, because a silent correction is its own mystery later.
191
+ if (chatId && !threadId && !args.steer && marker && marker.chatId === chatId && marker.threadId) {
192
+ threadId = marker.threadId;
193
+ console.error(`--thread missing: using topic ${threadId} of the turn running in this folder`);
194
+ }
186
195
  if (args.steer) {
187
196
  const found = jobOf(args.steer);
188
197
  if (!found) {
package/turn/progress.mjs CHANGED
@@ -5,7 +5,7 @@
5
5
  // file, rewritten between two other moves. Its inputs are the language, the
6
6
  // topic and the task; everything Telegram-facing comes from `telegram.mjs`, and
7
7
  // the layout from `panel.mjs` (a pure renderer, still untouched).
8
- import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
8
+ import { mkdirSync, readFileSync, statSync, unlinkSync, writeFileSync } from 'node:fs';
9
9
  import { join } from 'node:path';
10
10
  import { config, log, state } from '../core/state.mjs';
11
11
  import { THOUGHT_DIR } from '../core/paths.mjs';
@@ -418,6 +418,14 @@ export async function startProgress(chatId, threadId, lang = config.lang || 'en'
418
418
  // worth more than an empty promise of a trail.
419
419
  }
420
420
  }
421
+ // A turn that wrote no note leaves an empty file behind, and every turn
422
+ // creates one: 269 of 285 files in one real folder were 0 bytes. The card
423
+ // is finished by the time this runs, so nothing reads it again.
424
+ if (thoughtFile && notes === thoughtFile) {
425
+ try {
426
+ if (statSync(notes).size === 0) unlinkSync(notes);
427
+ } catch {}
428
+ }
421
429
  if (result?.stopped) {
422
430
  // The person pressed Стоп. The card says so in their words, not with a
423
431
  // ⚠️ and not with a retry button: nothing failed, and the session is