Skip to content

Make screenshot capture atomic and serialized - #333

Merged
hamzamerzic merged 1 commit into
mobius-os:mainfrom
hamzamerzic:fix/screenshot-tooling-simplification
Jul 28, 2026
Merged

Make screenshot capture atomic and serialized#333
hamzamerzic merged 1 commit into
mobius-os:mainfrom
hamzamerzic:fix/screenshot-tooling-simplification

Conversation

@hamzamerzic

Copy link
Copy Markdown
Collaborator

Problem

The authenticated screenshot helper can reuse one browser profile across parallel agents in the same chat. Without transaction ownership, two captures can interleave navigation and viewport changes. A failed final attempt also writes directly to the stable output path, so it can replace the last trustworthy image with a partial file. Browser command failures are repeatedly suppressed, while the fake-browser tests pay production retry sleeps and assert implementation text rather than behavior.

Fix

  • Serialize the complete capture transaction per browser profile with a bounded lock.
  • Capture into a same-directory temporary PNG, validate it, then atomically publish it so failures preserve the last known-good output.
  • Centralize the browser command and fatal-error boundaries while keeping the distinct semantic retry and readiness checks intact.
  • Surface the last useful browser diagnostic, require exact numeric in-shell app ids, and remove one pass-through viewport helper.
  • Make fake-browser tests hermetic and fast, and verify daemon identity behavior instead of shell source spelling.

Prior work

PR #321 established settled, correctly sized authenticated captures. This follow-up preserves those contracts and addresses the remaining output-publication, same-profile concurrency, diagnostic, and test-efficiency gaps.

Verification

  • Upstream review worktree: 44 focused screenshot and browser-environment tests passed in 9.9 seconds.
  • Shell syntax, Python compile, and canonical diff checks passed.
  • Authenticated live capture produced a served 1,512×861 PNG with one settled chat surface; the browser session closed cleanly.

Co-authored-by: Möbius Agent <mobius-agent@users.noreply.github.com>
@hamzamerzic hamzamerzic added area: infrastructure Build, CI, deployment, and recovery maintenance Internal cleanup, dependency, or upkeep work labels Jul 28, 2026
@hamzamerzic
hamzamerzic added this pull request to the merge queue Jul 28, 2026
Merged via the queue into mobius-os:main with commit 44759fa Jul 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: infrastructure Build, CI, deployment, and recovery maintenance Internal cleanup, dependency, or upkeep work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant