This commit is contained in:
2026-07-31 08:20:42 +08:00
parent 0d078e848c
commit 0d79cb7c73
6 changed files with 139 additions and 37 deletions
+3 -15
View File
@@ -704,21 +704,9 @@ export class KanbanWebviewPanel {
* review command. Used by the webhook auto-review flow so the user can watch
* codex work in real time instead of it running headless in the background.
*
* Re-use semantics: if a tab named `issue-${N}-审查` already exists (live, not
* exited), codex TUI is already running inside; we just `show` the tab and
* send a short follow-up message ("PR 更新了,再审一下") as the next user
* input so codex handles it as a new round, reusing the existing session
* context. We deliberately do NOT re-run the full
* `codex --dangerously-bypass-... '/review\n<prompt>'` startup command on
* reuse (it would be received as a long redundant user message, wasting
* tokens) and we do NOT restart the codex session watcher (reuse doesn't
* write a new rollout-*.jsonl, so the watcher would just idle until
* timeout). We do NOT track the terminal in `reviewTerminals` (that map is
* keyed by codex thread_id, which we don't have on this path).
*
* Returns true if the command was successfully dispatched, false if a
* pre-condition failed (single-quote in prompt — only checked on the
* new-terminal path since reuse sends a fixed string).
* 只有已持久化 reviewSessionId 时才注入 "PR 更新了,再审一下"tab 活着但
* session 尚未落盘时 noop,避免首次审查被竞态污染。详见
* `decideAutoReviewPath` / `sessions.triggerAutoReviewTab`。
*/
public async triggerAutoReviewTab(opts: {
issueNumber: number