Closed general

Report windows, recordings and screenshots the same as Windows (pup hwnd, on-screen background windows, empty takes, canvas, 3D Viewer kind)

John Lauer · 8d ago ·closed by Kyle Bergstedt

@kyle, a request from AI Flow's side. Hydrogen's promise is one normalized environment: an Adom tool written once should work the same on Windows and macOS. Joe Rouvier just finished a 387-part board on macOS (adom/adom-aiflow PR #54 and issue #123), and AI Flow had to grow macOS-only branches to find and record windows. We'd like the Mac bridge to answer the way the Windows one does, so no downstream app carries platform logic.

The differences we hit, Mac (Adom Bridge 1.9.x, KiCad 10.0, macOS 27.0.1) against Windows:

  1. pup_list_windows sessions have no hwnd. On Windows each session row carries its window handle. On Mac it's missing, so AI Flow now searches desktop_list_windows by title ("Adom Fields") to find the window, which is fragile when two windows share a title. Ask: include hwnd in each session row, the same handle desktop_* verbs accept.
  2. pup windows sit off-screen, and an off-screen window is never painted. pup keeps its window off-screen in the background (isOnscreen: false), so Chrome stops painting it. Screenshots show a stale "loading" frame, and window recordings come out empty. On Windows a background window stays on-screen but behind others, and WGC captures it live. Ask: keep background pup windows on-screen but unfocused (behind other windows, or minimized-but-capturable) so they paint, matching Windows. AI Flow 0.2.39 currently works around it with pup_raise_os_window around each take.
  3. desktop_record_window_start/_stop succeed with no file. On an off-screen window, start returns a recording id and stop returns normally, but no window-<id>.mp4 is written. Ask: return an error (or frames: 0 with a reason) when nothing was captured, as Windows reports frames/bytes.
  4. desktop_list_windows needs includeOffscreen to see pup windows at all. On Windows they're listed by default. This one may go away with item 2.
  5. Window screenshots carry no canvas analysis. Windows screenshot replies include canvas: {rendered, distinctColors}, which AI Flow uses to tell a painted 3D view from a blank one. On Mac AI Flow now counts colours itself with ffmpeg. Ask: same canvas block on Mac.
  6. The KiCad 3D Viewer has no kind. On Windows the editor list gives the 3D Viewer kind: "3d_viewer". On Mac only its title identifies it. If the Mac KiCad bridge manifest is yours, please set kind the same way; if it's the KiCad bridge's, tell me and I'll take it to that page.

Once these match, AI Flow will drop its macOS branches (title matching, the raise/lower around takes, its own colour count) and every other Adom app gets the same behaviour for free. I can test from the AI Flow side on any build you want, and Joe has a Mac board ready to rerun.

1 Reply

Kyle Bergstedt · 4d ago

Items 1-5 shipped in Bridge 1.9.232 and pup 3.0.1: pup rows carry hwnd; pup windows stay on screen behind your work, so they paint, record and list by default; an empty window take stops with no_frames_captured, frames:0, bytes:0; window screenshots carry canvas {rendered, distinctColors}. Item 6 is the KiCad bridge's: its native 1.0.98 sets kind "3d_viewer" and ships when that page publishes.

Kyle Bergstedt closed this · 4d ago

Log in to reply.