Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
91a79af
feat(sop): review runs in node conversations
Nov 25, 2026
3b0eec2
test(web): load run routes in queue interaction fixture
Nov 25, 2026
4868421
fix(chatbot): let node discussions send when the server lacks the def…
Nov 25, 2026
71f2f1b
fix(chatbot): show one install entry when a node chat reply fails on …
Nov 25, 2026
26a7fda
fix(sop): narrow the default review artifact drawer
Nov 25, 2026
c67d4da
test(e2e): cover stale SOP node conversation requests
Nov 25, 2026
a6a9bc1
Merge main 058a530b into codex/sop-conversation-review
Nov 25, 2026
afa8604
test(engine): pass the execution-selection flag in Runner credential …
Nov 25, 2026
af4108f
Merge main 832e2bef into codex/sop-conversation-review
Nov 25, 2026
56f5904
Merge main c039a78a into codex/sop-conversation-review
Nov 26, 2026
56a1064
fix(assistant): say LOOP in the node-discussion prompt
Nov 26, 2026
3aa63e8
Keep run navigation, diagnostics and workspace in context
codex Nov 26, 2026
c343923
Target the run info disclosure in the UI test
codex Nov 26, 2026
1d5440c
fix(web): keep the all-node log export with 执行详情; cover tab ARIA
Nov 26, 2026
dd500f8
Merge main fe6c45f0 into codex/sop-conversation-review
Nov 26, 2026
7c5ce2d
fix(web): open the requested run tab from the evolution center
Nov 26, 2026
c7f0a19
Merge origin/main into codex/sop-conversation-review
Nov 27, 2026
8d02e97
test(chatbot): cover knowledge citations in extracted chat turns and …
Nov 27, 2026
79e507e
Merge origin/main (fd039e51) into codex/sop-conversation-review
Nov 27, 2026
6a67deb
Merge main into codex/sop-conversation-review
Nov 28, 2026
407a7f3
fix(chat): restore the main reply imports after merging main into #1332
Nov 28, 2026
2d562e3
fix(runs): keep the review observation scope control after merging main
Nov 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 71 additions & 200 deletions chatbot/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,18 @@ import React, {
import { useChat } from "./useChat";
import NativeApprovalPanel from "./NativeApprovalPanel";
import { AgentBrowserLinks } from "./agent-browser-links.js";
import ActivityTrace, { ReplyTimeline } from "./ActivityTrace";
import { AssistantTurn, LiveMessage, MessageTime, UserTurn, replyText } from "./ChatTurns";
import MessageInfo from "./MessageInfo";
import MessageHistory from "./MessageHistory";
import GenerationDiagnostics from "./GenerationDiagnostics";
import { fullTime, messageSentAt, messageTimeLabel } from "./message-info.js";
import {
activityForReply,
finalReply,
generationStored,
hasTextSegments,
streamingAnswerOpen,
} from "./activity";
import {
api,
attachmentURL,
parseReply,
collectArtifacts,
visibleText,
elapsedSeconds,
formatElapsed,
confirmationCaption,
Expand All @@ -35,7 +29,6 @@ import {
projectPickerOptions,
} from "./api";
import {
RichContent,
CopyButton,
Attachment,
ArtifactPreview,
Expand All @@ -56,10 +49,9 @@ import { groupSessionHistory, scheduledSession, sessionProjectName } from "./ses
import { runSessionState, sessionReplyStatus, sessionTooltip, sidebarReplyStatus } from "./session-status.js";
import { unreadReply, useReadReplies } from "./session-unread.js";
import ReferenceInput from "./ReferenceInput";
import Participants, { Avatar, authorFor } from "./Participants";
import Participants, { Avatar } from "./Participants";
import IssueContext from "./IssueContext";
import { insertMention } from "./mentions.js";
import { elementTitle } from "./element-context.js";
import HarnessIcon from "./HarnessIcon";
import QueuedMessages from "./QueuedMessages";
import "./message-queue.css";
Expand Down Expand Up @@ -196,114 +188,9 @@ const readJSON = (key, fallback) => {
return fallback;
}
};
function MessageTime({ messages, index }) {
const date = messageSentAt(messages, index);
if (!date) return null;
return (
<time
className="message-time"
dateTime={date.toISOString()}
title={fullTime(date)}
>
{messageTimeLabel(date)}
</time>
);
}
function copiedReply(message, generation, live) {
const steps = activityForReply(message, generation, live);
const text = parseReply(message).message;
return hasTextSegments(steps) ? finalReply(text, steps) : text;
}
function ReplyHeading({ message, steps }) {
return (
<div className="reply-heading">
<ActivityTrace
steps={steps}
startedAt={message.startedAt}
finishedAt={message.createdAt}
interrupted={!!message.unfinished}
/>
</div>
);
}
function AssistantTurn({ message, steps, assets, projectId, sessionId, local, readOnly, onCLIInstall }) {
const reply = parseReply(message);
const answer = hasTextSegments(steps)
? finalReply(reply.message, steps)
: message;
return (
<>
{hasTextSegments(steps) ? (
<ReplyTimeline
steps={steps}
startedAt={message.startedAt}
finishedAt={message.createdAt}
/>
) : (
<ReplyHeading message={message} steps={steps} />
)}
<div className="message-body">
<RichContent message={answer} assets={assets} projectId={projectId} />
</div>
{message.failure && message.generationId && !local ? (
<GenerationDiagnostics sessionId={sessionId} generationId={message.generationId} failure={message.failure} onCLIInstall={onCLIInstall} readOnly={readOnly} />
) : message.unfinished ? (
<p className="reply-stopped">本轮未完成 · {message.unfinished}</p>
) : reply.stopped ? (
<p className="reply-stopped">已停止,以上是停止前的内容。</p>
) : null}
</>
);
return replyText(message, activityForReply(message, generation, live));
}
function LiveMessage({ live, generation, finished = false, local = false, readOnly = false }) {
const steps = live.activity || [];
const textual = hasTextSegments(steps);
// A streamed paragraph followed by tool calls stays in the process above;
// only the paragraph still being written shows as the answer.
const answer =
live.draftMessage ||
(textual
? finished || streamingAnswerOpen(steps)
? finalReply(live.answer, steps)
: ""
: live.answer);
return (
<div
className={`message assistant ${finished ? "interrupted" : "live"}`}
aria-live="polite"
>
{textual ? (
<ReplyTimeline
steps={steps}
startedAt={generation?.startedAt}
finishedAt={generation?.updatedAt}
live={!finished}
interrupted={finished}
/>
) : (
<div className="reply-heading">
<ActivityTrace
steps={steps}
startedAt={generation?.startedAt}
finishedAt={generation?.updatedAt}
live={!finished}
interrupted={finished}
/>
</div>
)}
{answer ? <RichContent message={answer} /> : null}
{!finished && !local && !readOnly && generation?.id ? <GenerationDiagnostics sessionId={generation.sessionId} generationId={generation.id} compact /> : null}
{finished ? (
<p className="reply-stopped">
{generation?.status === "failed" && generation?.error
? generation.error
: "已停止,以上是停止前的内容。"}
</p>
) : null}
</div>
);
}

function readIssueMention() {
const params = new URLSearchParams(location.search);
const issueId = params.get("mentionIssue") || "";
Expand Down Expand Up @@ -649,6 +536,10 @@ export default function App() {
setQuickAccessOpen(true);
return;
}
if (event.data?.type === "agentflow-run-review-updated") {
setRunsRefresh((n) => n + 1);
return;
}
if (event.data?.type !== "agentflow-chat-mention-issue") return;
const issueId = String(event.data.issueId || "");
const projectId = String(event.data.projectId || "");
Expand Down Expand Up @@ -824,6 +715,15 @@ export default function App() {
setPanel(true);
setSelectedArtifact(a);
}
function openRunNode(run, nodeId) {
openArtifact({
kind: "run",
id: run.id,
runId: run.id,
name: run.workflowSnapshot?.name || "SOP 运行",
nodeId,
});
}
function navigate(view, options = {}) {
if (window.parent !== window)
window.parent.postMessage(
Expand Down Expand Up @@ -1349,6 +1249,14 @@ export default function App() {
<div className="header-actions">
{chat.session ? (
<>
{chat.session.runNodeReview && conversationRuns.some(({ id }) => id === chat.session.runId) ? (
<IconButton label="查看原 SOP 节点" onClick={() => openRunNode(
conversationRuns.find(({ id }) => id === chat.session.runId),
chat.session.runNodeReview.nodeId,
)}>
<HarnessIcon name="workflow" size={16} />
</IconButton>
) : null}
{conversationStarted ? <ExecutionMachinePicker chat={chat} onManage={() => navigate("runners")} /> : null}
{projectName ? (
<div className="menu-anchor conversation-project-anchor">
Expand Down Expand Up @@ -1676,82 +1584,52 @@ export default function App() {
/>
) : null}
{message.role === "user" ? (
<div className="message-body">
<>
<div className="message-author">
<Avatar
person={authorFor(
message,
chat.session,
chat.users,
)}
/>
<span>
{
authorFor(message, chat.session, chat.users)
.name
}
</span>
<MessageTime messages={messages} index={index} />
</div>
<div className="user-bubble">{message.content}</div>
{message.references?.length ? (
<div className="message-references">
{message.references.map((ref) => (
<span
key={ref.type + ref.id}
title={ref.type === "element" ? elementTitle(ref) : undefined}
>
{ref.type === "element" ? (
<HarnessIcon name="crosshair" size={12} />
) : (
"@"
)}
{ref.name || ref.id}
</span>
))}
</div>
<UserTurn
message={message}
messages={messages}
index={index}
session={chat.session}
users={chat.users}
>
<div className="user-actions">
{!chat.readOnly ? (
<>
<IconButton
label="编辑消息"
disabled={chat.busy}
onClick={() =>
setDialog({
type: "edit",
index,
value: message.content,
fork: false,
})
}
>
<HarnessIcon name="edit" size={14} />
</IconButton>
<IconButton
label="从此处创建分支"
disabled={chat.busy}
onClick={() =>
setDialog({
type: "edit",
index,
value: message.content,
fork: true,
})
}
>
<HarnessIcon name="branch" size={14} />
</IconButton>
</>
) : null}
<div className="user-actions">
{!chat.readOnly ? (
<>
<IconButton
label="编辑消息"
disabled={chat.busy}
onClick={() =>
setDialog({
type: "edit",
index,
value: message.content,
fork: false,
})
}
>
<HarnessIcon name="edit" size={14} />
</IconButton>
<IconButton
label="从此处创建分支"
disabled={chat.busy}
onClick={() =>
setDialog({
type: "edit",
index,
value: message.content,
fork: true,
})
}
>
<HarnessIcon name="branch" size={14} />
</IconButton>
</>
) : null}
<CopyButton
value={message.content}
label="复制消息"
/>
</div>
</>
</div>
<CopyButton
value={message.content}
label="复制消息"
/>
</div>
</UserTurn>
) : null}
{message.attachments?.length ? (
<div className="message-attachments">
Expand Down Expand Up @@ -1834,15 +1712,7 @@ export default function App() {
users={chat.users}
readOnly={chat.readOnly}
onChanged={() => setRunsRefresh((n) => n + 1)}
onOpenNode={(run, nodeId) =>
openArtifact({
kind: "run",
id: run.id,
runId: run.id,
name: run.workflowSnapshot?.name || "SOP 运行",
nodeId,
})
}
onOpenNode={openRunNode}
onAsk={(item) => {
setText(
`运行 ${item.runId} 的「${item.nodeName}」节点${item.kind === "failed" ? "失败了" : "在等待人工确认"},帮我分析具体卡在哪里、原因是什么、需要谁做什么。`,
Expand Down Expand Up @@ -2284,6 +2154,7 @@ export default function App() {
browserRequest={browserRequest}
onBrowserRequestHandled={browserRequestHandled}
onAddElement={chat.readOnly ? null : addElementReference}
onRunChanged={() => setRunsRefresh((n) => n + 1)}
onClose={() => setPanel(false)}
/>
) : null}
Expand Down
Loading
Loading