You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by wy...@apache.org on 2026/10/20 01:35:46 UTC

(maka) branch rust-preview updated: fix(desktop): read WorkHub task notices in every language (#6178)

This is an automated email from the ASF dual-hosted git repository.

M4n5ter pushed a commit to branch rust-preview
in repository https://gitbox.apache.org/repos/asf/maka.git


The following commit(s) were added to refs/heads/rust-preview by this push:
     new 9c78b32495 fix(desktop): read WorkHub task notices in every language (#6178)
9c78b32495 is described below

commit 9c78b324955f10f5e2266eab46b3de032f66fe9a
Author: UDY4M <72...@users.noreply.github.com>
AuthorDate: Tue Oct 20 09:35:41 2026 +0800

    fix(desktop): read WorkHub task notices in every language (#6178)
    
    The Host now writes a task's notice in its resolved language (dc158c054),
    so the desktop no longer found the English "Original worker observation"
    line in a Chinese notice, and the notice row lost the task's worker and
    outcome. The task's JSON is the notice's last line in every language, so
    it is read from there.
    
    Generated-by: Claude Code
---
 products/maka/cli/notices.json                |  2 +-
 products/maka/desktop-shell/app/transcript.js | 15 ++++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/products/maka/cli/notices.json b/products/maka/cli/notices.json
index 46095d29ef..6fa38e6639 100644
--- a/products/maka/cli/notices.json
+++ b/products/maka/cli/notices.json
@@ -462,7 +462,7 @@
     "products/maka/desktop-shell/app/subagents.js": "42622acd0cc2926781bd8eb1347393b89caf9f5e8a9213545b03c23690975691",
     "products/maka/desktop-shell/app/terminal.js": "dc4e9f7d7387ed6bc14f3cb2fb6af2c3e236df4bff799adf9c964c8a564b984b",
     "products/maka/desktop-shell/app/theme.js": "55866ee3fe2137e4ebb015a88cafbed02cbec1f95d2c11f2c820c40e3b4475b1",
-    "products/maka/desktop-shell/app/transcript.js": "1a5e717b15e8e98ba043dad968e336cab265d2dde0b8e6d3045fef75a3df0b68",
+    "products/maka/desktop-shell/app/transcript.js": "8fb270d7a35fd1e1b9f8e975be00b0cd091d3442cd9f4550462b49863ef14908",
     "products/maka/desktop-shell/app/workbar.js": "a59d515945e6c6634ed5f446129e36a23b4de93154443eb30d2b3471d516e9cb",
     "products/maka/desktop-shell/app/workhub.js": "cd1555c73ee9f25ccbfba4ea375ed2bd67787d63f30500035da30ace40258b88",
     "products/maka/native/Cargo.toml": "4a3c69dfe3d7e5773316dbd0f703ec376cbaef0a7b9915fce395b8460c633d76",
diff --git a/products/maka/desktop-shell/app/transcript.js b/products/maka/desktop-shell/app/transcript.js
index 0c183df388..fed26b2d7c 100644
--- a/products/maka/desktop-shell/app/transcript.js
+++ b/products/maka/desktop-shell/app/transcript.js
@@ -1448,7 +1448,6 @@ function failureRow(item, cx) {
     );
 }
 
-const WORKHUB_NOTICE_OBSERVATION = '\n\nOriginal worker observation:\n';
 // A task's notice recorded before the Host kept origins (de2c51a4b): its
 // message id is `m_wh_` and a SHA-256 (workhub/tasks/notifications.rs), and
 // its text starts by naming the task.
@@ -1470,10 +1469,12 @@ function originOf(row) {
  * What a WorkHub notice says: `{ graph, taskId, worker, outcome }`. History
  * gives the message's origin, a task (`taskId`) or a task graph (`graph`,
  * which says the graph has new results). A task's notice text ends with the
- * task as JSON, from which come its worker and its outcome: 'completed',
- * 'failed', 'cancelled', 'rejected', or null when it cannot be read (the
- * text is not all loaded, or its form changed). The text is the Host's fixed
- * English, for the coordinator's model; the row says it in the user's words.
+ * task as one line of JSON, from which come its worker and its outcome:
+ * 'completed', 'failed', 'cancelled', 'rejected', or null when it cannot be
+ * read (the text is not all loaded, or its form changed). The text is for
+ * the coordinator's model, in the language the Host resolves for it when it
+ * is written (workhub/tasks/notifications.rs); the row says it in the
+ * user's words.
  */
 function workhubNotice(row) {
   const origin = originOf(row);
@@ -1485,10 +1486,10 @@ function workhubNotice(row) {
     outcome: null,
   };
   if (!ofTask) return notice;
-  const at = row.text.indexOf(WORKHUB_NOTICE_OBSERVATION);
+  const at = row.text.lastIndexOf('\n');
   if (at < 0) return notice;
   try {
-    const task = JSON.parse(row.text.slice(at + WORKHUB_NOTICE_OBSERVATION.length));
+    const task = JSON.parse(row.text.slice(at + 1));
     const status = task?.status ?? {};
     const work = status.progress ?? {};
     notice.worker = typeof task?.worker === 'string' ? task.worker : null;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org