Repository navigation
Serve browser and desktop views from the Go worker - #97
Merged
devin-ai-integration[bot] merged 11 commits intoNov 24, 2026
Merged
Conversation
Ports the view op from browser-view.mjs and desktop-view.mjs to the worker. It serves the ComputerRequest fields the service's computer.watch / computer.input send (#81). Rebased onto main after #80 squash-merged; same content as devin/1795452868-worker-computer-views at 161b199. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Emit ready once with a UUIDv4 viewer id, then one frame event per screen image, as apps/api computer.ts does; the decimal id failed the computer.input uuid pattern and opened/message events were never rendered. Prepare the service on open, as views.ts does, so a browser that cannot produce frames fails instead of leaving a blank stream. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
views.ts viewAccess throws when another viewer holds the lease or the lease went stale, and refuses non-ack input without a lease; a signed-in viewer could otherwise type into a Bot-owned computer. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
viewer-types.ts discriminates on type (ack, take, back, text, key, pointer); reading action left every message unmatched, so acks were rejected as unleased input and take/back never ran. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
control() keys an isolated browser by browser:<botId> and shares the desktop lane otherwise; one global lease per service let a second Bot's grant kill an unrelated viewer's lease. The browser's sharedDesktop prepare result maintains the isolation set. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
views.ts forwards "back" to the worker while the lease still stands so it can clear a held pointer, then releases; releasing first made the request fail the lease gate. take also no longer reaches the worker's send, which has no such message. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
omitempty dropped the false that marks a headless browser's own control lane, so a desktop takeover froze its viewers' acknowledgements (browser-service.mjs reports mode === "headed" either way). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
services.ts takeover throws when the control already holds a lease; overwriting it silently revoked the active viewer's control without a hand-back. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
services.ts assigns the control lease before awaiting settle, so a closing viewer's release always sees the reservation. Claiming it afterwards let a grant land on a dead viewer and lock the lane for every later takeover. A failed settle now also gives the claim back. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
views.ts keeps the grant as view.taking: input is refused while it settles, a repeated take or request awaits the same grant instead of reporting control it never received, and back/close wait for it before releasing. A pending grant authorized input before this, and a repeated takeover reported a grant that could still fail. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Unlocked grant fields let two takes each open a channel and close the other's or nil, and a retry could overwrite the failure a waiter was about to read. A per-view mutex and a per-attempt result keep every caller on the grant it awaited. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
deleted the
devin/1795452868-worker-computer-views-v2
branch
November 24, 2026 07:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supersedes #83 (auto-closed when #80's branch was deleted). Same content, rebased onto main after #80's squash merge — review history lives on #83.
Ports the
viewop frombrowser-view.mjsanddesktop-view.mjsto the worker. It serves theComputerRequestfields the service'scomputer.watch/computer.inputsend (#81).ViewComputerResult.ResultopenViewIDfrom the service; a reopened ID replaces its view{})next{"messages":[{seq, data (base64), mimeType, width, height, timestamp}]}sendMessage: the TSViewerAction(type: ack, text, key, pointer, back)closeA view is bound to the service and
dirthat opened it, and worker shutdown closes it.worker.Clientalso has a typedOpenView→Next/Send/Closeover the same wire.Browser
agent-browser stream status --jsonmust report an enabled port in 1..65535.session_infoonhttp://127.0.0.1:<port>/api/commandmust return the Bot'sAGENT_BROWSER_SESSIONbefore the worker dialsws://127.0.0.1:<port>/?pacing=ack&maxFps=30.EINVAL.COMPUTER_UNCERTAIN, so agent actions needRestartBrowser.Desktop
get_desktop_stateat 1920px withsession: <viewID>. The next capture waits for the ack plus 500 ms.type_text/hotkey/press_key/click/drag(over 3 px) /move_cursor/scroll, aimed at{kind: desktop, display_id: primary}.CursorColoron open is unused. In TS the cursor theme is applied on desktopcalls, which is a separate change.This PR adds
github.com/coder/websocketfor the stream client.TestComputerBrowserViewandTestComputerDesktopViewrun over stdio and SSH against a fake stream server and fake Cua tools.Link to Devin session: https://app.devin.ai/sessions/dd13702c910149ffaa30fc2797fa3b72
Open in Devin Desktop: https://app.devin.ai/desktop/session/dd13702c910149ffaa30fc2797fa3b72?variant=devin
Requested by: @Personed
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work