Skip to content

feat(computer): publish computer-use activity and the recording frame on the AG-UI stream - #1441

Merged
edenreich merged 2 commits into
mainfrom
fix/issue-1404
Sep 30, 2026
Merged

edenreich merged 2 commits into
mainfrom
fix/issue-1404

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1404

Summary

The desktop overlay and monitor no longer need to reverse-engineer computer-use activity from tool payloads: the computer context now publishes what it is doing on the standard AG-UI stream itself. Each pointer or keyboard action lands as an ACTIVITY_SNAPSHOT activity titled computer_use (still standard AG-UI, no CUSTOM event), and the screenRecording state key grows the recording's file and frame rectangle while a capture runs, so every client reads one shape. The mapping stays owned by the computer context in internal/computer/published_events.go, exactly as before.

Changes

  • New agentdomain.ComputerUseActionEvent, notified by the Executor just before a pointer (move, click, double_click, triple_click) or keyboard (type, key) action runs, carrying the tool call id, the action name and its coordinates already scaled to the real screen, plus screenWidth/screenHeight
  • computer.PublishedEvent maps that event to the computer_use activity keyed computer_use:<toolCallId>; keyboard actions carry no x/y, all field names camelCase
  • agentdomain.ScreenRecordingStatusEvent now carries the recording's path, its frame-space region (RegionX/Y/Width/Height) and frameWidth/frameHeight; the recorder fills them at start, PublishedEvent folds them into the screenRecording state value (active stays bare on stop)
  • The end event still stops the indicator: clients clear it on RUN_FINISHED/RUN_ERROR, unchanged
  • The headless uiBridge forwards the new event into the rendered stream, so one-shot headless and the daemon worker both emit it on stdout
  • The Computer tool and computer.NewTools take the shared UI notifier, wired from the container
  • docs/ag-ui-output.md documents the computer_use activity and the extended screenRecording state with their shapes; internal/computer/README.md describes the new publishing
  • Tests: internal/computer covers the mapping of both events (pointer with coordinates, keyboard without, recording state with the frame) and the recorder's start payload; the headless run encoder tests cover both the activity and the state on the wire

Downstream: the desktop app overlay and monitor (the #1396 epic) can now subscribe to these events instead of parsing Computer args and RecordStart results. Tracked there; the CLI's own docs page is updated in this PR.

Docs: tracked in the docs repo as inference-gateway/docs#878 (the in-repo page docs/ag-ui-output.md is updated in this PR).

… on the AG-UI stream

The executor notifies a ComputerUseActionEvent before each pointer or keyboard action and PublishedEvent maps it to the computer_use activity, while ScreenRecordingStatusEvent now carries the file and frame space of a running recording into the screenRecording state. Headless bridges both onto stdout for one-shot and serve runs.
… event and name the publisher

The headless render tests decode ACTIVITY_SNAPSHOT events through the
existing wireEvent and decodeEvents helpers instead of a second decoder.
The executor's activity method is renamed publishActivity so its call
sites read as what they do.
@edenreich
edenreich merged commit 06ba9f4 into main Sep 30, 2026
12 checks passed
@edenreich
edenreich deleted the fix/issue-1404 branch September 30, 2026 23:12
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.221.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Computer-use action and recording events for the desktop overlay and monitor

1 participant