Repository navigation
Recover confirmed task starts and show their execution #8649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
loopx-agent
wants to merge
14
commits into
main
Choose a base branch
from
codex/confirmed-task-result-20261112
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,957
−209
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
68e5da4
fix(chat): recover confirmed task starts through canonical claims
loopx-agent cd35c89
fix(chat): open the accepted task execution from its confirmation
loopx-agent 8091255
fix: execute real backend journeys in Dashboard source acceptance (#8…
cocolord 76a0d14
fix(change-quality): preserve CR and CRLF in Git paths (#8645)
gcl-coder 2b45afd
fix(integration-branch): preserve worktree paths with line breaks (#8…
gcl-coder 56fc2a1
fix(lark): rediscover App messages after transcript replacement (#8653)
loopx-agent d118ada
fix(core): enable guided natural-language startup and identity routes
cocolord ce69003
Merge pull request #8658 from loopx-project/codex/rfc-r1-minimal-mana…
cocolord cef0204
Defer issue-fix execution imports during goal startup
cocolord 8f6fb36
Keep installed outcome refinement guidance reachable
cocolord 1cb6caf
Merge pull request #8661 from loopx-project/codex/rfc-r1-composition-…
cocolord f6cde42
fix(chat): verify bound history source before publishing (#8664)
huangruiteng b9acf18
Merge confirmed-task proposal with current main
loopx-agent 13bd68b
Read the exact execution from a confirmed task receipt
loopx-agent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
apps/presentation/dashboard/src/features/personal-workspace/confirmed-task-result.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import {useEffect, useId, useState} from "react"; | ||
| import {fetchConfirmedTaskTurn} from "../../data/chat"; | ||
| import {visibleAgentMessage} from "./answer-text"; | ||
| import {localizedSessionStatus, useWorkspaceI18n} from "./i18n"; | ||
| import {MarkdownText} from "./markdown"; | ||
|
|
||
| type TaskReceipt = Parameters<typeof fetchConfirmedTaskTurn>[0]; | ||
| type Result = Awaited<ReturnType<typeof fetchConfirmedTaskTurn>>; | ||
|
|
||
| export function ConfirmedTaskResult({receipt}: {receipt: TaskReceipt}) { | ||
| const {t} = useWorkspaceI18n(); | ||
| const panelId = useId(); | ||
| const [open, setOpen] = useState(false); | ||
| const [read, setRead] = useState<Result | Error | null>(null); | ||
| const [retry, setRetry] = useState(0); | ||
| const {goalId, todoId, sessionId, turnId} = receipt; | ||
| useEffect(() => { | ||
| if (!open) return; | ||
| const controller = new AbortController(); | ||
| let next: ReturnType<typeof setTimeout> | undefined; | ||
| async function load() { | ||
| try { | ||
| const result = await fetchConfirmedTaskTurn({goalId, todoId, sessionId, turnId}, controller.signal); | ||
| if (controller.signal.aborted) return; | ||
| setRead(result); | ||
| if (!result.turn.terminal) next = setTimeout(load, 2_500); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 原任务回执在 Chat 重启后持续等待。 隔离 wheel 上真实终止并重启 Chat 服务,连续三次原回执查询和重放确认均保留 running。普通会话读取将同一轮次变为 failed,原 provider 调用仍一次。让回执通过现有执行恢复 owner 核对所选的 Session 和 Turn。读到已退出的 worker 时显示原轮次的终态与恢复说明。保留无关轮次和纯历史读取的边界。 增加仅打开原回执的真实重启回归。 |
||
| } catch { | ||
| if (!controller.signal.aborted) setRead(new Error()); | ||
| } | ||
| } | ||
| void load(); | ||
| return () => { controller.abort(); clearTimeout(next); }; | ||
| }, [open, goalId, todoId, sessionId, turnId, retry]); | ||
|
|
||
| const result = read && !(read instanceof Error) ? read : null; | ||
| const messages = result?.turn.terminal | ||
| ? result.messages.filter(message => ["agent", "assistant", "error"].includes(message.role)) | ||
| .map(message => ({...message, text: visibleAgentMessage(message.text)})).filter(message => message.text) | ||
| : []; | ||
| return <> | ||
| <button aria-controls={panelId} aria-expanded={open} className="personal-primary-action" | ||
| onClick={() => {setRead(null); setOpen(!open);}} type="button">{t(open ? "drawer.taskReceiptHideResult" : "drawer.taskReceiptShowResult")}</button> | ||
| <section aria-label={t("drawer.taskReceiptResult")} className="personal-detail-card personal-task-receipt-result" | ||
| id={panelId} hidden={!open}> | ||
| <h3>{t("drawer.taskReceiptResult")}</h3> | ||
| {read instanceof Error ? <> | ||
| <p role="status">{t("drawer.taskReceiptMissing")}</p> | ||
| <button className="personal-secondary-action" onClick={() => {setRead(null); setRetry(value => value + 1);}} | ||
| type="button">{t("proposal.readbackRetry")}</button> | ||
| </> : !result ? <p role="status">{t("drawer.taskReceiptReading")}</p> | ||
| : !result.turn.terminal ? <p role="status">{t("drawer.taskReceiptPending")}</p> | ||
| : <> | ||
| <p role="status">{result.turn.status === "timed_out" ? t("drawer.taskReceiptTimedOut") | ||
| : localizedSessionStatus(result.turn.status, t)}</p> | ||
| {messages.length ? <div className="personal-task-receipt-answer"> | ||
| {messages.map(message => <MarkdownText key={message.message_id} headingLevel={4} text={message.text} />)} | ||
| </div> | ||
| : <p>{t("drawer.taskReceiptNoResult")}</p>} | ||
| </>} | ||
| </section> | ||
| </>; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 在终止状态先于错误消息写入时保留回执重读。 原任务已提交;执行器失败,Turn 的终止状态刚提交,错误消息仍在写入,用户此时打开原回执。ChatRuntimeController._fail_turn 先 update_turn(status=failed),随后 append_message(role=error);project_chat_session_snapshot 只按 status 推出 terminal,ConfirmedTaskResult 收到 terminal 后停读,空结果分支也没有重试。 打开的回执若先读到 failed、后收到该轮错误消息,会一直显示“本次执行已结束,未返回结果”;真正的原因只在收起再打开后出现。 让已有精确 Turn 读取区分终止状态与结果已可读;在失败、超时或中断的可见结果尚未写入时,允许同一 Turn 有界重读或给出就地重试。不要重启任务,也不要切到 Session 的新 Turn。 在打包 Chat 的真实 SQLite 路径暂停失败消息 append 前的 IO,用 Enter 打开原回执;确认错误写入后,同一打开面板可显示原因或就地重读,协议 turn/start 次数不增加。