fix(preview): hung-frame watchdog + require approval for guessed action calls #11

Merged
enderofwings merged 5 commits from fix/preview-watchdog-and-guard into main 2026-08-26 18:15:14 +00:00
Owner

Carries #6 (PR git.enderofwings.com/enderofwings/NexusOS/pulls/6, Athena) forward with two fixes found in review:

  • Preview iframe watchdog: a hung/runaway script (sync infinite loop, or a re-render loop outpacing the bootstrap coalescing) is now detected via a 1s heartbeat and the frame is torn down after 6s of silence, instead of spinning indefinitely.
  • _coerce_tool_calls-recovered action tool calls (guessed from content, no native tool_calls field) now always require approval, even under action_tool_policy="allow" - that heuristic is weaker evidence than the APIs own structured field.

Built directly on 6/head (952ef8a) - all of #6 plus this one commit. Merge this instead of #6.

Carries #6 (PR git.enderofwings.com/enderofwings/NexusOS/pulls/6, Athena) forward with two fixes found in review: - Preview iframe watchdog: a hung/runaway script (sync infinite loop, or a re-render loop outpacing the bootstrap coalescing) is now detected via a 1s heartbeat and the frame is torn down after 6s of silence, instead of spinning indefinitely. - `_coerce_tool_calls`-recovered action tool calls (guessed from `content`, no native tool_calls field) now always require approval, even under action_tool_policy="allow" - that heuristic is weaker evidence than the APIs own structured field. Built directly on 6/head (952ef8a) - all of #6 plus this one commit. Merge this instead of #6.
enderofwings added 4 commits 2026-08-26 18:09:39 +00:00
Render validated HTML, SVG, JSX, and TSX fences locally while preserving tool context and preventing explanatory JSON from triggering actions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Load Sucrase only when a JSX/TSX preview is opened, remove the hand-written transform, and leave subjective render evaluation to the reader while retaining structural fence validation.
A runaway preview script (sync infinite loop, or a re-render loop
outpacing the bootstrap's own coalescing) had nothing detecting it -
the frame just spun. The bootstrap now heartbeats every second, and the
parent tears the iframe down if it goes _WATCHDOG_MS silent, whatever
the cause.

_coerce_tool_calls recovers a tool call guessed from `content` for
models with no native tool_calls field. That guess is weaker evidence
than the API's own structured field - a model can land on JSON shaped
like a call while only meaning to describe one - so an action tool
recovered this way now always requires approval, even under the
"allow" policy that lets a native tool_calls field run unattended.
enderofwings added 1 commit 2026-08-26 18:14:05 +00:00
enderofwings merged commit 8bc8123bfa into main 2026-08-26 18:15:14 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: enderofwings/NexusOS#11