fix: preserve oneliner suggested action context
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
|
||||
## 2026-04-05
|
||||
|
||||
### OneLiner 对话里的直接执行建议保留完整上下文
|
||||
|
||||
- OneLiner 助手消息里的 `suggested_actions` 现在不再只是渲染成一个裸 `data-action` 标签。
|
||||
- 前端会把每条建议对应的 `executor_key / platform / payload / session_id` 一起带上,所以“直接分析账号 / 直接同步跟踪池 / 直接创建 AI 视频”这类建议从对话里点下去时,会真正走当前 live 执行器。
|
||||
- 这让 OneLiner 对话、运行卡、结果卡三条链的“直接执行”行为终于统一,不会再出现运行卡能跑、对话建议却丢上下文的断层。
|
||||
|
||||
### 主 Agent 可直接执行分析账号、加入跟踪、创建 Agent
|
||||
|
||||
- `OneLiner / 主 Agent` 的动作执行器现在新增了三条真实动作:
|
||||
|
||||
@@ -1385,7 +1385,12 @@ function renderOneLinerMessagesHtml() {
|
||||
` : ""}
|
||||
${actions.length ? `
|
||||
<div class="task-meta" style="margin-top:10px;">
|
||||
${actions.map((item) => `<span class="tag clickable-tag" data-action="${escapeHtml(item.key)}">${escapeHtml(item.label)}</span>`).join("")}
|
||||
${actions.map((item) => actionTag(
|
||||
item.label || item.executor_label || item.key || "执行动作",
|
||||
item.key || "",
|
||||
buildOnelinerActionAttrs(item),
|
||||
{ disabledReason: item.disabled_reason || "" }
|
||||
)).join("")}
|
||||
</div>
|
||||
` : ""}
|
||||
${message.role === "assistant" && (executionCard.intent_label || executionCard.platform_label || executionCard.primary_action?.label || safeArray(executionCard.evidence).length) ? `
|
||||
|
||||
@@ -1134,6 +1134,10 @@ test("main agent execution cards can jump to oneliner and platform profile histo
|
||||
const runtime = extractBetween(APP, "function renderOneLinerRunsHtml()", "function renderOneLinerMessagesHtml()");
|
||||
const execution = extractBetween(APP, "function renderOneLinerExecutionPayloadHtml(payload)", "function parseOneLinerActionPayloadValue(value)");
|
||||
assert.match(messages, /const buildOnelinerActionAttrs = \(item\) =>/);
|
||||
assert.match(messages, /actions\.map\(\(item\) => actionTag\(/);
|
||||
assert.match(messages, /item\.label \|\| item\.executor_label \|\| item\.key \|\| "执行动作"/);
|
||||
assert.match(messages, /buildOnelinerActionAttrs\(item\)/);
|
||||
assert.doesNotMatch(messages, /actions\.map\(\(item\) => `<span class="tag clickable-tag" data-action="\$\{escapeHtml\(item\.key\)\}">\$\{escapeHtml\(item\.label\)\}<\/span>`\)/);
|
||||
assert.match(messages, /data-action="open-oneliner-profile-history"/);
|
||||
assert.match(messages, /data-action="open-platform-agent-profile-history"/);
|
||||
assert.match(messages, /data-version-id="\$\{escapeHtml\(profileVersion\.version_id \|\| ""\)\}"/);
|
||||
|
||||
Reference in New Issue
Block a user