Merge pull request '上下文压缩日志仅显示状态' (#12) from codex/quiet-context-compaction into main
Verify control plane / verify (push) Canceled after 0s

Reviewed-on: http://git.xhmcl.com/xhgit/webup-cloud/pulls/12
This commit was merged in pull request #12.
This commit is contained in:
xhgit committed 2026-11-08 04:03:07 +00:00
commit 1f25bbd1f9
3 files changed
+9 -7

No files matched your search

@@ -68,7 +68,9 @@ public class TaskController {
@AuthenticationPrincipal SecurityConfig.Identity who, @PathVariable UUID id) { @AuthenticationPrincipal SecurityConfig.Identity who, @PathVariable UUID id) {
tasks.find(id, who.id()); tasks.find(id, who.id());
return db.queryForList( return db.queryForList(
"SELECT * FROM (SELECT * FROM ai_task_steps WHERE task_id=? AND event NOT IN" "SELECT id,task_id,event,created_at,CASE WHEN event='CONTEXT_COMPACTED' THEN"
+ " '压缩上下文中' ELSE detail END AS detail FROM (SELECT * FROM ai_task_steps WHERE"
+ " task_id=? AND event NOT IN"
+ " ('AUTO_SETTLEMENT','MANUAL_SETTLEMENT') ORDER BY created_at DESC,id DESC LIMIT" + " ('AUTO_SETTLEMENT','MANUAL_SETTLEMENT') ORDER BY created_at DESC,id DESC LIMIT"
+ " 1000) AS recent ORDER BY created_at,id", + " 1000) AS recent ORDER BY created_at,id",
id); id);
@@ -299,7 +299,7 @@ public class TaskService {
history.through()); history.through());
if (updated != 1) throw new ApiError.Failure(409, "任务上下文交接记录已更新"); if (updated != 1) throw new ApiError.Failure(409, "任务上下文交接记录已更新");
} }
event(id, "CONTEXT_COMPACTED", "已自动压缩上下文并开启下一段对话,继续当前任务"); event(id, "CONTEXT_COMPACTED", "压缩上下文中");
} }
public Map<String, Object> config(UUID id) { public Map<String, Object> config(UUID id) {
+5 -5
View File
@@ -621,11 +621,11 @@ onUnmounted(() => clearInterval(timer));
@scroll.passive="trackLogScroll" @scroll.passive="trackLogScroll"
> >
<div v-for="e in events" :key="e.id"> <div v-for="e in events" :key="e.id">
<small <small>
>{{ new Date(e.created_at).toLocaleTimeString() }} · {{ new Date(e.created_at).toLocaleTimeString() }}
{{ e.event }}</small <template v-if="e.event !== 'CONTEXT_COMPACTED'"> · {{ e.event }}</template>
> </small>
<pre>{{ e.detail }}</pre> <pre>{{ e.event === "CONTEXT_COMPACTED" ? "压缩上下文中" : e.detail }}</pre>
</div> </div>
<p v-if="!events.length" class="empty">等待任务事件</p> <p v-if="!events.length" class="empty">等待任务事件</p>
</div> </div>