Review every new snapshot with an agent from the other vendor
This commit is contained in:
Vendored
+17
-1
@@ -2,6 +2,7 @@ import { get, post } from "./api.js";
|
||||
import { ago, errorText, h, replace, showAlert, showConfirm } from "./dom.js";
|
||||
import { markdown } from "./markdown.js";
|
||||
import { previewURL } from "./preview.js";
|
||||
import { reviewCounts } from "./reviews.js";
|
||||
import { currentSession, findTask, focusTab, focusTask, onEach, pinSnapshot, setFocus, state } from "./state.js";
|
||||
import { taskStyle } from "./taskcolor.js";
|
||||
export const models = [
|
||||
@@ -177,6 +178,7 @@ export function mountChat(root, src, makeHead) {
|
||||
const newCtx = () => ({
|
||||
tools: new Map(),
|
||||
subagents: new Map(),
|
||||
reviewers: new Set(),
|
||||
run: undefined,
|
||||
lastMessage: undefined,
|
||||
held: undefined,
|
||||
@@ -320,7 +322,7 @@ export function mountChat(root, src, makeHead) {
|
||||
stream = undefined;
|
||||
};
|
||||
const appendDelta = (ev) => {
|
||||
if (ctx.handoff) {
|
||||
if (ctx.handoff || (ev.agent_session_id && ctx.reviewers.has(ev.agent_session_id))) {
|
||||
return;
|
||||
}
|
||||
if (!stream) {
|
||||
@@ -368,6 +370,13 @@ export function mountChat(root, src, makeHead) {
|
||||
for (const ev of events) {
|
||||
const p = ev.payload;
|
||||
const parent = parentOf(p);
|
||||
if (ev.kind === "session.created" && p["role"] === "reviewer" && ev.agent_session_id) {
|
||||
ctx.reviewers.add(ev.agent_session_id);
|
||||
continue;
|
||||
}
|
||||
if (ev.agent_session_id && ctx.reviewers.has(ev.agent_session_id)) {
|
||||
continue;
|
||||
}
|
||||
if (ev.kind === "agent.vendor") {
|
||||
claudeTaskStatus(p, ctx);
|
||||
continue;
|
||||
@@ -879,6 +888,13 @@ function renderEvent(ev, ctx) {
|
||||
}
|
||||
case "task.merge_title":
|
||||
return h("div", { class: "note" }, `${ev.actor} set the merge commit title to "${String(p["merge_title"])}" `, when);
|
||||
case "review.finished": {
|
||||
const r = p;
|
||||
const open = h("button", { type: "button", title: "Show the task's reviews" }, "reviews");
|
||||
open.onclick = () => focusTab("reviews");
|
||||
const outcome = r.state === "failed" ? `failed: ${r.error}` : reviewCounts(r);
|
||||
return h("div", { class: `note${r.state === "failed" ? " error" : ""}` }, `review of snapshot #${r.snapshot_n}: ${outcome} `, when, " ", open);
|
||||
}
|
||||
case "task.merge_queued":
|
||||
return h("div", { class: "note" }, `${ev.actor} asked to merge; held until the merge in progress in this project is done `, when);
|
||||
case "preview.exposed": {
|
||||
|
||||
Reference in New Issue
Block a user