✨ feat(vscode): state JSON 新增 handoffAttachmentId/handoffFrom,Issue 透出 assignees
Claude-Session: https://claude.ai/code/session_011cEyL6k351U2BzX1Qmygph
This commit is contained in:
1 parent
3ddafafe3d
commit
4b66d567b0
11 files changed
+60
-6
No files matched your search
@@ -88,6 +88,8 @@ function parseColumnFromComments(comments: GiteaComment[]): {
|
||||
testSessionId?: string
|
||||
color?: string
|
||||
autoReview?: boolean
|
||||
handoffAttachmentId?: string
|
||||
handoffFrom?: string
|
||||
} {
|
||||
if (comments.length === 0)
|
||||
return { column: null }
|
||||
@@ -132,6 +134,8 @@ function parseColumnFromComments(comments: GiteaComment[]): {
|
||||
testSessionId?: unknown
|
||||
color?: unknown
|
||||
autoReview?: unknown
|
||||
handoffAttachmentId?: unknown
|
||||
handoffFrom?: unknown
|
||||
}
|
||||
if (isIssueColumn(obj.column)) {
|
||||
const sessionId = typeof obj.sessionId === 'string' && obj.sessionId.length > 0
|
||||
@@ -180,6 +184,12 @@ function parseColumnFromComments(comments: GiteaComment[]): {
|
||||
? obj.color
|
||||
: undefined
|
||||
const autoReview = typeof obj.autoReview === 'boolean' ? obj.autoReview : undefined
|
||||
const handoffAttachmentId = typeof obj.handoffAttachmentId === 'string' && obj.handoffAttachmentId.length > 0
|
||||
? obj.handoffAttachmentId
|
||||
: undefined
|
||||
const handoffFrom = typeof obj.handoffFrom === 'string' && obj.handoffFrom.length > 0
|
||||
? obj.handoffFrom
|
||||
: undefined
|
||||
return {
|
||||
column: obj.column,
|
||||
sessionId,
|
||||
@@ -200,6 +210,8 @@ function parseColumnFromComments(comments: GiteaComment[]): {
|
||||
testSessionId,
|
||||
color,
|
||||
autoReview,
|
||||
handoffAttachmentId,
|
||||
handoffFrom,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,6 +338,8 @@ async function buildIssue(opts: {
|
||||
testSessionId,
|
||||
color,
|
||||
autoReview,
|
||||
handoffAttachmentId,
|
||||
handoffFrom,
|
||||
} = parseColumnFromComments(comments)
|
||||
// 优先用 PR API 实时结果;失败时退回 state JSON 持久化值。
|
||||
const prMerged = liveMerged !== undefined ? liveMerged : persistedMerged
|
||||
@@ -392,6 +406,9 @@ async function buildIssue(opts: {
|
||||
...(prerequisite !== undefined ? { prerequisite } : {}),
|
||||
...(color ? { color } : {}),
|
||||
...(autoReview !== undefined ? { autoReview } : {}),
|
||||
...(handoffAttachmentId ? { handoffAttachmentId } : {}),
|
||||
...(handoffFrom ? { handoffFrom } : {}),
|
||||
assignees: (issue.assignees ?? []).map(a => a.login),
|
||||
htmlUrl: issue.html_url,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { listIssueComments, postIssueComment } from './api'
|
||||
* 普通文本评论、审查评论、Gitea 自动关联评论都不含这些字段,因此从尾往前
|
||||
* 扫描时会被跳过,避免它们插队后下一次 merge 从空状态开始丢历史。
|
||||
*/
|
||||
const KNOWN_STATE_FIELDS = ['column', 'sessionId', 'implementSessionId', 'reviewSessionId', 'testSessionId', 'profilePath', 'brainstormProfilePath', 'testProfilePath', 'specFile', 'planFile', 'prDiffFile', 'pr', 'prMerged', 'prMergedAt', 'branch', 'worktreePath', 'implementStatus', 'color', 'autoReview'] as const
|
||||
const KNOWN_STATE_FIELDS = ['column', 'sessionId', 'implementSessionId', 'reviewSessionId', 'testSessionId', 'profilePath', 'brainstormProfilePath', 'testProfilePath', 'specFile', 'planFile', 'prDiffFile', 'pr', 'prMerged', 'prMergedAt', 'branch', 'worktreePath', 'implementStatus', 'color', 'autoReview', 'handoffAttachmentId', 'handoffFrom'] as const
|
||||
|
||||
/**
|
||||
* body 能 parse 成 object 且含至少一个已知 state 字段 → 认为是 state JSON。
|
||||
|
||||
@@ -88,6 +88,12 @@ export interface Issue {
|
||||
* webhook coordinator uses this value instead of the global flag. Stored
|
||||
* in the issue's state-JSON comment so it survives reloads. */
|
||||
autoReview?: boolean
|
||||
/** Gitea assignee login 列表;接管按钮只对 assignee 含当前登录者的工单显示。 */
|
||||
assignees?: string[]
|
||||
/** 移交会话包的 Gitea 附件 id(字符串);存在即「待接管」。 */
|
||||
handoffAttachmentId?: string
|
||||
/** 发起移交的 Gitea login。 */
|
||||
handoffFrom?: string
|
||||
/** Whether the brainstorm terminal tab is currently alive in this VS Code window. */
|
||||
brainstormTabOpen?: boolean
|
||||
/** Whether the implementation terminal tab is currently alive in this VS Code window. */
|
||||
|
||||
Reference in new issue
Block a user