diff --git a/frontend/packages/agent/src/hooks/useAgentState.ts b/frontend/packages/agent/src/hooks/useAgentState.ts index c36e7aaa..306d8e49 100644 --- a/frontend/packages/agent/src/hooks/useAgentState.ts +++ b/frontend/packages/agent/src/hooks/useAgentState.ts @@ -1,13 +1,5 @@ -// useAgentState — polls `GET /api/state` and exposes the latest -// snapshot + loading/error status. Mirrors app.js's old `refreshState` -// data fetch, not its exact re-poll cadence: the old page re-polled on a -// timer only while a login was in flight, and otherwise waited for an -// SSE `turn_end` event to trigger one-shot refreshes. That SSE-triggered -// model is permanently off the table now — the terminal stream's `kind` -// tag (what let a client single out a turn-boundary event) is gone by -// design, see `useLiveStream.ts`'s module doc — so this hook's flat 4s -// interval is the only refresh path, not a placeholder for a later -// commit. +// useAgentState — polls `GET /api/state` every 4s and exposes the latest +// snapshot + loading/error status. import { useEffect, useRef, useState } from 'preact/hooks'; import type { AgentState } from '../types.js'; diff --git a/frontend/packages/agent/src/hooks/useLiveStream.ts b/frontend/packages/agent/src/hooks/useLiveStream.ts index 79ce767d..5aaa9a67 100644 --- a/frontend/packages/agent/src/hooks/useLiveStream.ts +++ b/frontend/packages/agent/src/hooks/useLiveStream.ts @@ -12,18 +12,9 @@ // terminal.js's `start()`: a live envelope landing between EventSource- // open and the history response resolving is buffered, not dropped or // double-counted (`envelope.seq <= history.seq` → already covered by the -// initial history page, drop it from the buffer). There's no per-row -// `kind` any more to sanity-check that against — `seq` alone is the +// initial history page, drop it from the buffer). `seq` alone is the // whole dedup signal, see `TermEnvelope`'s doc in hive-agent's // `web_ui/stream.rs`. -// -// The old `onLiveTurnBoundary` callback (a snappier one-off `/api/state` -// refresh right after a live turn_start/turn_end, instead of waiting for -// the plain poll interval) is gone with the `kind` tag it relied on to -// spot a turn boundary — per mara's own framing that trigger is an -// agent-state concern, not a terminal-stream one, and this stream no -// longer has the structure to single one out. `useAgentState`'s 4s poll -// is the only refresh path now. import { useEffect, useRef, useState } from 'preact/hooks'; import type { TermEnvelope, TermRow } from '../lib/termMsg.js'; diff --git a/hive-agent/src/stream_enrich.rs b/hive-agent/src/stream_enrich.rs index ced925b6..39921b9d 100644 --- a/hive-agent/src/stream_enrich.rs +++ b/hive-agent/src/stream_enrich.rs @@ -271,8 +271,7 @@ fn classify_assistant_content(content: &[Value], ctx: &mut ClassifyCtx) -> Vec TermMsg { let name = c.get("name").and_then(Value::as_str).unwrap_or(""); let input = c.get("input").cloned().unwrap_or_else(|| json!({})); @@ -427,10 +426,6 @@ fn classify_task_event(v: &Value) -> Option { /// - `"markdown"` → rendered via `marked` + `DOMPurify`; used for /// message-bearing tools: `send` /// -/// Whether the resulting row renders open or collapsed is a uniform -/// client-side preference (the operator's expand-tool-output setting), -/// not something this function or its `body_type` decides. -/// /// Returns `None` for tools that have no body at all. /// /// **`Write` is intentionally absent**: its `content` field can be megabytes diff --git a/hive-agent/src/term_msg.rs b/hive-agent/src/term_msg.rs index df0715cb..df4da3d7 100644 --- a/hive-agent/src/term_msg.rs +++ b/hive-agent/src/term_msg.rs @@ -106,8 +106,7 @@ impl TermMsg { /// actually returned, not across the live/history boundary. Accepted /// degradation — the only user-visible effect is a `recv` result whose /// `tool_use` fell on the other side of a page/reconnect boundary rendering -/// its body as plain text instead of markdown (open/collapsed state is a -/// uniform client-side preference either way, not affected by this). +/// its body as plain text instead of markdown. #[derive(Default)] pub struct ClassifyCtx { tool_name_by_id: HashMap,