Repository navigation
Conversation
david6666666
left a comment
There was a problem hiding this comment.
REQUEST CHANGES 6818188 Refs #535
Dot, acting for @david6666666. Non-voting review.
The inline finding is about the decision notification contract, not the sound or popup controls.
Ran: inspected the pinned diff and the Release checks run; it requires maintainer action and is not green.
Not run: independent browser or audio playback. No total: reviewed head is behind current main.
| ): TaskOutcome | null { | ||
| if (message.role !== "assistant") return null; | ||
| if (message.status === "complete") | ||
| return asksForDecision(message.text) ? "decision" : "completed"; |
There was a problem hiding this comment.
This treats a completed reply ending in a question as an actual wait for a decision. A completed reply can end with a follow-up offer, and a genuine approval request need not end with a question mark. #535 calls for the authoritative waiting state. Could the decision notification consume that state (or be deferred until it is available), with regression coverage for both cases?
There was a problem hiding this comment.
Thanks for catching this. Updated the branch to consume the authoritative interaction state instead of inferring from the reply text.
ask_user/opendirector ask-usercreates a host-owned interaction. The host persists it and sets the assistant message toawaiting_decisiononly whileinteraction.status === "pending".agentTaskOutcomenow returnsdecisiononly for:
status === "awaiting_decision" && interaction.status === "pending".- A completed reply ending in
?— including a follow-up offer — remainscompleted. - Approval-like wording without an interaction remains
completed; a genuine approval request must come throughask_user/the CLI bridge. - Answered or cancelled interactions do not trigger a decision notification.
- Closing or restarting the turn cancels a pending interaction and marks the message
interrupted. - The pending interaction event is published after the Agent lease pause; closing during that pause cancels it.
- Removed the old
asksForDecisionquestion-mark heuristic.
Regression coverage:
tests/taskNotifications.test.ts: pending, answered, null, question-ending complete, and approval-like complete cases.tests/test_agent_interactions.py: ask, option validation, close, pause/resume and close-during-pause.tests/test_assistant_conversations.pyandtests/test_cli.py: API lifecycle and CLI bridge.tests/test_native_runtime.py: native gate coverage; the real OpenCode case is environment-gated and skipped locally.
Local checks:
npm test: 1040 passednpm run build: passednpm run check:i18n: 3484 keys, 0 problems- Python interaction/API/CLI tests: 82 passed
- Native gate: 2 passed, 1 skipped
The branch is rebased onto current main in 6467e326. I did not re-record the new decision card in a browser/audio session, so I am not claiming that as verified.
Could you re-review the updated commit?
6818188 to
6467e32
Compare
david6666666
left a comment
There was a problem hiding this comment.
REQUEST CHANGES 6467e32 Refs #535
Dot,代表 @david6666666。
当前证据暂定 45/100(非批准分)。 范围 3/3,正确性 2/3,验证 2/3,主张证据 0/3,简洁性 0/3。
上次的问号误判已修:现在只在宿主确实有待答交互时通知。新入口还需要确保同一个问题只能结算一次,我把并发回答的疑问留在对应代码处。作者报告前后端定向测试通过,但 Release checks 仍需维护者操作,现有录像也早于新决策卡。补并发回归后,建议再录一次「收到提醒 → 打开决策卡 → 回答后续跑」。我没重跑测试。解释性代码注释按量表记零。
English summary: 45/100 provisional. The authoritative wait-state fix is in place. Serialize concurrent answers and attach current-tip decision workflow evidence.
| if not text and not option_id: | ||
| raise ProjectError('请输入回答或选择选项。', 422) | ||
| if self.resume_after_user is not None: | ||
| await self.resume_after_user() |
There was a problem hiding this comment.
这里检查 future.done() 之后,会先等租约、再等持久化。两个标签页如果几乎同时答同一个问题,可能都越过前面的检查,后一个回答覆盖前一个,或在 set_result() 时碰到已经结算的 future。能否在第一次 await 前先认领这一条回答,并让第二次稳定返回 409?建议用可暂停的租约或持久化回调写一个并发回归。
There was a problem hiding this comment.
Fixed in af98c8f9: the first valid answer now claims the interaction before the first await, so a concurrent answer returns 409; answer and close also share one gate lock so the question cannot settle twice. The regression pauses the resume callback, submits two answers, and separately covers close-during-answer. The PR update includes the rebased head and current recordings.
david6666666
left a comment
There was a problem hiding this comment.
Dot,代表 @david6666666。
当前证据暂定 53/100(非批准)。 范围、正确性、验证、证据、简洁性依次为 3/3、3/3、2/3、0/3、0/3。
之前提的双标签页同时回答已修:回答和关闭串行,新增用例确认只接收一次回答、只恢复一次。我没发现同一处还有需要再标的代码问题。Release checks 仍需维护者操作,新决策卡也还没录到真实流程。下一步补「收到通知、回答、任务续跑」的录像;我没有重跑浏览器。
English summary: 53/100. Concurrent-answer handling is covered by a targeted regression. Release checks and the decision-card recording are still outstanding.
david6666666
left a comment
There was a problem hiding this comment.
上一轮核对的重复回答并发修复仍在;这次变化是 #380 合入后,GitHub 已标记当前分支有合并冲突。两边都改了聊天、Agent 后端和会话测试。重整时请一起复验决策卡回答、通知和 Chat/Canvas 切换时的会话状态。沿用的录屏没有覆盖这次决策卡版本,不能当作当前 UI 验收。Release checks 在此 head 仍未执行。
当前证据暂定 53/100(非批准分),范围/正确性/验证/主张证据/简洁性依次为 3/3,3/3,2/3,0/3,0/3。只核对到现有 head;实际 merge base dbb36f0da98d566ab4479e7c736cb763285e2eb4,当前 main 561c3d43a140fd34f6432b2b9cd6cd8014e10c73。未运行冲突解决后的验证。
Dot,代表 @david6666666。
7970f06 to
af98c8f
Compare
|
Updated head: Thanks for the re-check. I rebased the branch onto current main (
The decision entry now claims the interaction before the first await; a concurrent answer gets 409, and I added
Current-head evidence is in the PR description, including the preserved earlier notification recordings. The new decision recordings include captured app audio. The recording does not claim OS-level notification permissions. The release checks still need maintainer action. Could you re-review the updated head? |
david6666666
left a comment
There was a problem hiding this comment.
已对齐 #380,旧合并冲突已消失。双标签回答、关闭与回答的互斥仍在;新增浏览器用例确实覆盖了切换 Chat/Canvas 后决策卡仍可回答。但它只比对切换前后屏幕上的通知数量,不能证明过程中没有再发一次。我在对应断言留了建议。
基线 561c3d43a140fd34f6432b2b9cd6cd8014e10c73。当前 head 的 Release checks 等待人工放行,未独立运行浏览器。作者补了录屏并注明音频取自应用内 Web Audio,不是系统回环;本轮打开两段新视频均超时,暂不能给素材分。
当前证据暂定 53/100(非批准分):范围 3/3,正确性 3/3,验证 2/3,主张证据 0/3,简洁性 0/3。优先把通知断言改为检查发出次数,再补能打开的当前版本视频。
Dot,代表 @david6666666。
| await waitMode("agent"); | ||
| assert.equal(await workspace.getAttribute("data-workspace-mode"), "agent"); | ||
| assert.equal(await card.isVisible(), true, "decision card must survive returning to Agent mode"); | ||
| assert.ok(await decisionToasts.count() <= initialToasts, |
There was a problem hiding this comment.
这里比的是两个时刻的 toast 数,不是发出的次数。原 toast 自动消失后,如果切回来又弹了一条,计数仍然是 1,测试也会过。能否从发送前记录一次通知事件(或用 MutationObserver 计新增节点),切换后断言同一个决策只发过一次?
There was a problem hiding this comment.
You're right. The previous assertion compared toast counts at two instants, so an auto-expired toast could hide a second emission.
Updated in 56138cef:
- Install a
MutationObserverbefore sending the turn. - Count newly seen decision toast nodes whose text contains
决定, deduplicated with aWeakSet. - Assert exactly one emission after the initial pending state.
- Switch
Agent → Canvas → Agentand assert the count is still exactly one. - Then answer and verify the turn resumes and completes.
david6666666
left a comment
There was a problem hiding this comment.
这版改对了:发送前开始记录新出现的决策 toast,即使旧 toast 先消失,也不会把重复弹出的那一条漏掉。用例还检查了切换 Agent → Canvas → Agent 后决策卡仍可回答,并验证回答后任务继续。
基线和实际合并基点均为 561c3d43,对齐当前 main;本次只改上一个 tip 的浏览器断言。该 head 的 Release checks 仍为 action_required,没有可核验的 Release 作业结果。未独立跑浏览器;作者给的两个录屏链接再次连接超时,暂不能核验视频或听到提示音。
当前证据暂定 53/100(非批准分):范围 3/3、正确性 3/3、验证 2/3、主张证据 0/3、简洁性 0/3(整体 diff 仍有新增解释性注释)。下一步请附可直接打开、注明录制提交的音视频,并等这个 tip 的 Release checks 出结果。
English: The toast regression now counts emissions. Current-head CI and playable recordings remain unverified.
Dot,代表 @david6666666。
Current decision flow
The mode-transition recording shows the toast, the decision card remaining pending through Earlier notification recordingsThe earlier decision recordings predate the authoritative decision card; they are retained as historical notification-surface evidence.
Could you re-check the recordings now that they are GitHub-hosted? |
david6666666
left a comment
There was a problem hiding this comment.
谢谢把录屏迁到 GitHub。我重试了两段当前决策流程录像,下载和网页读取均未成功,暂时没法核对提示音或从切模式到回答的完整画面。之前的通知次数回归仍然有效,没有新的代码行意见。
当前 head 的 Release checks 仍是 action_required;实际合并基点 561c3d43、落后当前 main 7685c838 一个提交。未独立运行浏览器。暂定 53/100(非批准分):范围 3/3、正确性 3/3、验证 2/3、主张证据 0/3、简洁性 0/3。建议对齐主干,并提供能独立下载、标明录制 SHA 的当前素材。
English: Retried the new attachments without playback. Current-head Release checks remain unsettled.
Dot,代表 @david6666666。
david6666666
left a comment
There was a problem hiding this comment.
更正上轮:我通过 GitHub 附件下载并核验了六段录像,不再因预览失败给证据计零。两段当前录像显示决策卡、切换工作区后保留待答状态、选择「暖色」后任务继续;两段音轨均检出与等待决策及完成对应的两次提示音。较早的中英文录像也显示了设置和生成成功/失败提示。录像是应用内 Web Audio,不是系统回环;浏览器整页刷新和断线重连未在录像里单独演示,刷新去重有 ledger 单测支持。
当前证据暂定 73/100(原 53,非批准分):范围 3/3、正确性 3/3、验证 2/3、主张证据 2/3、简洁性 0/3。未独立运行应用;该提交 Release checks 仍待放行,实际基点 561c3d43 落后当前主干一个提交。下一步对齐 main、跑完 CI,并补整页刷新/重连不重复通知的演示可把证据补齐。
English: Downloaded and checked the recordings and app audio; reload/reconnect video and Release checks remain outstanding.
Dot,代表 @david6666666。
- Announce user-started Agent turns when they finish, fail, or ask a question. - Announce canvas generations the user started; keep agent-submitted jobs with their turn. - Add a short chime, project/task/status toast, and an action back to the conversation or node. - Persist announced task identities so reloads and reconnects do not repeat a chime. - Cover the decision rule, origin filtering, and reload dedupe with tests. - Add zh-CN and en-US catalogs. Fixes ThinkFlowLab#535
- Add separate task sound and popup switches. - Add a persisted 0-100% volume slider with an in-settings preview. - Keep the previous loudness at the 30% default. - Gate task chimes and toasts independently. - Cover preference parsing and volume bounds with unit tests.
- Add an ask_user tool and CLI command that wait for an explicit user answer. - Persist pending interactions with the owning turn and expose answer endpoints. - Release and reacquire the Agent write lease while waiting for the user. - Mark unanswered interactions interrupted after a restart. - Render an in-chat decision card and notify from the authoritative state. - Add gate, CLI bridge, API lifecycle, notification and browser coverage. - Verify the bundled OpenCode harness waits for ask-user with a mock model.
- Register the pending future before releasing the project lease. - Publish the pending interaction only after the lease is released, so an answer cannot race the resume path. - Cancel a question closed during pause without leaving the ask call stranded. - Cover pause/event ordering and close-during-pause.
- Claim the interaction before resume or persistence so concurrent tabs cannot both settle it. - Let the losing answer return False and the API map it to 409. - Roll the in-memory answer back if persistence fails, allowing a retry. - Add a concurrent-answer regression that pauses the resume callback.
- Guard answer and close with one gate lock so a question cannot settle twice. - Keep the in-flight answer while close waits, rather than racing a cancelled persist against answered. - Add close-during-answer regression coverage.
- Only take the write repair path when the committed conversation contains a stale streaming or awaiting status. - Keep ordinary conversation reads available while ThinkFlowLab#380 publishes canvas changes. - Preserve restart cleanup for genuinely orphaned in-flight messages.
- Add an isolated fixture prompt that produces an authoritative ask_user wait. - Verify the pending decision card survives Agent -> Canvas -> Agent mode changes. - Verify the decision notification is not duplicated and the answer resumes the turn.
- Replace the before/after toast-count assertion with a MutationObserver that counts decision toast nodes. - Assert exactly one notification is emitted before and after Agent -> Canvas -> Agent mode changes. - Prevent an auto-expired toast from masking a second notification.
56138ce to
39ee590
Compare
|
Updated head: The branch is now rebased onto current main Current verification:
I added the two remaining current-head demos with captured app audio:
Both recordings include the app's captured audio. They do not claim OS-level notification behavior. The current-head Release checks still need maintainer action. Could you re-review the rebased head? |
david6666666
left a comment
There was a problem hiding this comment.
谢谢补上两段带声音的录像。我下载看了画面,也检查了音轨。刷新那段能看见页面重载、原决策卡回来、回答后任务继续;等待决策的提示音只出现一次。重连那段也只检出一次决策提示音,回答后另有一次完成提示音。但画面没显示网络确实从离线切回在线;如果跑录制时有网络切换日志,补一小段就能把这项对上。
暂定 73/100(非批准分):范围 3/3、正确性 3/3、验证 2/3、主张证据 2/3、简洁性 0/3。已对齐 04a770c9;当前 Release checks、CodeQL 和 DSH 都待 maintainer 放行。作者本地报告 1,060 前端测试及 90 项 Python 测试通过;我未独立运行应用。应用内录音不代表系统通知。
English: Verified both recordings and the reload behavior. Network transition and current-head CI remain unverified.
Dot,代表 @david6666666。
|
Hi @david6666666 @princepride — quick request on CI. This PR comes from a fork, so the first workflow run is waiting on maintainer approval (per #135). CI hasn't started yet, which means there's no signal for either of us to act on. Could someone with write access approve the workflow run so CI can execute? The code and evidence are ready; once CI runs, I'll address any failures or remaining review points promptly. Thanks! |
Summary
Adds task notifications for user-started Agent turns and canvas generations. Refs #535.
agentRunId) do not notify on their own; the owning turn reports the result.zh-CNanden-UScatalogs.Decision notifications now consume the host-owned
ask_user/opendirector ask-userinteraction, not a question-mark heuristic:awaiting_decision→decision?/?→completedcompletedThe branch is rebased on current main (
561c3d43) and resolves the#380Chat/Canvas-mode overlap. The combined regression verifies that a pending decision survivesAgent → Canvas → Agent, does not duplicate its notification, and resumes after the answer.Evidence
Current authoritative decision flow
These recordings were made on the current branch with the authoritative decision card. The combined recording includes the app's captured chime.
Agent → Canvas → Agentwith captured audioThe mode-transition recording shows:
ask_user.暖色.已选择 warm。.The audio is captured from the app's actual Web Audio output graph at the configured 30% volume. It is not a separately synthesized replacement. It is also not OS speaker loopback: this WSL environment has no usable sound device.
Earlier notification recordings
These recordings are retained from the earlier notification work. The two decision recordings show the older toast presentation and predate the authoritative decision card; they are kept as evidence for the notification surface, not as the current decision-contract recording.
Verification
npm test— 1060 passed.npm run build— passed.npm run check:i18n— 3522 keys, 0 problems.pytest tests/test_agent_interactions.py tests/test_assistant_conversations.py tests/test_cli.py— 90 passed.pytest tests/test_native_runtime.py -k 'ask_user or bundled_model_declares or rejects_removed_runtime'— 2 passed, 1 skipped (real OpenCode path environment-gated).node tests/browser/workspace_modes.mjs— pass: bilingual chat docking, dragging, keyboard movement, bounds, persistence, shared draft, uninterrupted reference upload and running tasks.node tests/browser/decision_workspace_modes.mjs— pass: pending card survives Agent → Canvas → Agent, notification emitted exactly once, answer resumes and completes.npm run check:browser-manifest— 108 entries, OK.Provider verification
Bilingual UI
zh-CNanden-UScatalogs are updated for settings, task notification copy and decision UI copy.Implementation notes
Job.agentRunIdis projected into the canvas job row to distinguish user-started generation from Agent-submitted work.agentRunId.TaskNotificationLedgerpersists announced identities inlocalStorage, bounded to avoid growth.InteractionGateowns one turn's authoritative question.ask_userand the CLI bridge persist the interaction before publishing it; the message becomesawaiting_decisiononly while that interaction is pending.answerandcloseshare one gate lock, so a question cannot be settled twice.cancelledand its messageinterrupted; no stale decision notification is inferred.Scope decisions and limitations
ask_useror theopendirector ask-userCLI to produce a waiting decision. Harnesses without either path do not get an authoritative decision notification; a completed question is not treated as one.Follow-ups