Răsfoiți Sursa

goals: goal-run terminal deep-links, fake daemon subtask-status channel dropped

The goal page's run rows now deep-link their session's terminal view
(?session_id=N lands on exactly that run through the client-side
picker), and the fake daemon drops its dead subtask-status handler
(the web no longer delivers that channel).
clanker 1 lună în urmă
părinte
comite
ebc7c349c2
2 a modificat fișierele cu 16 adăugiri și 23 ștergeri
  1. 13 10
      src/entrypoints/GoalDetailEntrypoint.vala
  2. 3 13
      test/web_stack_test.py

+ 13 - 10
src/entrypoints/GoalDetailEntrypoint.vala

@@ -412,16 +412,19 @@ namespace ClankerSaddle {
                     .where(expr("task_id == $0", elem<int64?>(pub.run_task_id)))
                     .order_by_desc(expr("id"))
                     .materialise_async();
-                foreach (var session in session_rows) {
-                    runs.add(new GoalRunView() {
-                        id = session.id,
-                        started_display = format_stamp(session.started_at),
-                        ended_display = format_stamp(session.ended_at),
-                        open = session.ended_at == null,
-                        outcome = session.outcome ?? "",
-                        terminal_url = @"/tasks/$(pub.run_task_id)/terminal"
-                    });
-                }
+                    foreach (var session in session_rows) {
+                        runs.add(new GoalRunView() {
+                            id = session.id,
+                            started_display = format_stamp(session.started_at),
+                            ended_display = format_stamp(session.ended_at),
+                            open = session.ended_at == null,
+                            outcome = session.outcome ?? "",
+                            // Deep-links this run's terminal view: the
+                            // picker's client-side ?session_id=
+                            // selection lands on exactly this session.
+                            terminal_url = @"/tasks/$(pub.run_task_id)/terminal?session_id=$(session.id)"
+                        });
+                    }
             }
 
             if (goal.branch_push_state != null

+ 3 - 13
test/web_stack_test.py

@@ -465,9 +465,6 @@ class FakeSaddle:
         self.suspend_on_title = None    # this task (by title) parks as suspended
         self.output_seq = 100           # daemon-global entry ids for pushed results
         self.last_activity_epoch = int(time.time())
-        self.subtask_status_events = []  # recorded /task-update subtask-status payloads
-        self.subtask_fail_hits = 0        # delivery attempts that 500ed (fail_subtask_status)
-        self.fail_subtask_status = False  # exercise the web's retry path
         self.hang_next = {}             # path suffix -> hang count (never responds)
         self.abort_failures = 0          # cancel task-updates failing (500) while > 0
         self.abort_log = []              # task ids aborted via task-update cancel
@@ -775,9 +772,9 @@ class FakeSaddle:
                 self._send(409, {"error": "no block is waiting for an answer — parks resume via allocation"})
                 return
             if self.path == "/task-update":
-                # Plan 10: cancel (abort machinery), comment (injected
-                # turn) and subtask-status (live subtask set) — delivered
-                # directly to a RUNNING daemon, no auth.
+                # Plan 10: cancel (abort machinery) and comment
+                # (injected turn) — delivered directly to a RUNNING
+                # daemon, no auth.
                 try:
                     payload = json.loads(raw)
                 except ValueError:
@@ -801,13 +798,6 @@ class FakeSaddle:
                 elif kind == "comment":
                     self.daemon.comment_log.append(payload)
                     self._send(200, {"ok": True})
-                elif kind == "subtask-status":
-                    if self.daemon.fail_subtask_status:
-                        self.daemon.subtask_fail_hits += 1
-                        self._send(500, {"error": "simulated failure"})
-                        return
-                    self.daemon.subtask_status_events.append(payload)
-                    self._send(200, {"ok": True})
                 else:
                     self._send(400, {"error": "unknown task-update kind"})
                 return