dsh-task-board-tapd 0.5.3 → 0.5.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/host/service.js +12 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-task-board-tapd",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "description": "TAPD 任务看板插件:在 DeepSeek Harness 客户端内查看与操作 TAPD 需求/任务/缺陷(列看板、搜索、改状态、评论、新建需求、Agent 工具)。",
6
6
  "license": "MIT",
@@ -289,16 +289,6 @@ export class TapdBoardService {
289
289
  sessionId = created?.sessionId || ''
290
290
  }
291
291
  if (!sessionId) throw new Error('无法创建独立会话')
292
- // 会话创建接口不接收标题,标题通过 rename 设置;rename 失败仅降级,不阻断调度创建
293
- if (sessionId) {
294
- try {
295
- if (typeof sessions.rename === 'function') {
296
- await sessions.rename({ sessionId, title: sessionTitle })
297
- }
298
- } catch (error) {
299
- console.warn(`[tapd-task-board] rename session ${sessionId} failed: ${error?.message || error}`)
300
- }
301
- }
302
292
 
303
293
  // ③ 到点触发的 Agent 指令(Agent 具备 tapd_board_* 工具,可读详情、改状态、评论等)
304
294
  const item = { type, id, title: payload.title || '', url: payload.url || '' }
@@ -326,6 +316,18 @@ export class TapdBoardService {
326
316
  target: { kind: 'session', sessionId },
327
317
  })
328
318
 
319
+ // ⑤ 调度创建成功后,才给会话设置固定标题 `<type>#<id>`。
320
+ // 顺序很重要:改名必须晚于 schedule.create —— 否则调度失败会遗留一个
321
+ // 「已被改名为 story#… 的空白会话」,而 DSH 新建会话时会复用未归档的空白会话,
322
+ // 导致用户手动创建的会话继承这个错误标题。改名失败仅告警,不影响已注册的调度。
323
+ try {
324
+ if (typeof sessions.rename === 'function') {
325
+ await sessions.rename({ sessionId, title: sessionTitle })
326
+ }
327
+ } catch (error) {
328
+ console.warn(`[tapd-task-board] rename session ${sessionId} failed: ${error?.message || error}`)
329
+ }
330
+
329
331
  const run = {
330
332
  id: String(record?.id || ''), scheduledAt: at, sessionId, type, itemId: id,
331
333
  workspaceId, dshWorkspaceId, workspacePath,