Skip to content

fix(computer): guard Linux type_text and press_key against GNOME Overview and empty active window (WHI-1046) - #778

Open
Kilyn544 wants to merge 1 commit into
mainfrom
fix/whi-1046-linux-no-active-window-guard
Open

Kilyn544 wants to merge 1 commit into
mainfrom
fix/whi-1046-linux-no-active-window-guard

Conversation

@Kilyn544

@Kilyn544 Kilyn544 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes WHI-1046 (Linux GNOME Activities Overview / unfocused desktop causing type_text and press_key to type into the Overview search box while reporting completed: true).

Root Cause

  1. In linux.go, checkWindow and runActions only compared current vs previously observed active window, so "" == "" passed and xdotool exit code 0 was reported as completed: true.
  2. In GNOME 42.9 X11, pressing Escape once to clear Overview search leaves Overview open while restoring _NET_ACTIVE_WINDOW to the underlying app window, and Super has a 100–300ms async delay before _NET_ACTIVE_WINDOW clears.

Changes

  • apps/computer/local-daemon/internal/linger/localtools/local_linux.py:
    • Added gnome_overview_active() using in-process gi.repository.Gio/GLib session D-Bus (org.gnome.Shell OverviewActive, NO_AUTO_START, 300ms timeout, no unsafe mode, no XDG_CURRENT_DESKTOP gate), cleanly returning False on non-GNOME desktops.
    • Updated active_window() to normalize X11 None ("0") to "" and return "" whenever gnome_overview_active() is True.
  • apps/computer/local-daemon/internal/linger/localtools/linux.go & linux_native.go:
    • Defined errNoActiveWindow = fmt.Errorf("NO_ACTIVE_WINDOW: ...: %w", errNotSent) directly (reusing server.go:toolError for isError: true and outcome: "not_dispatched" without altering other err != nil && state == nil paths).
    • Added the single active-window gate in Go (checkWindow, single-step linuxComputerCall, and runActions before step 0 and between steps with a single 250ms settle after bare overview-escape keys). Allows bare Escape/Esc/Super/Super_L/Super_R/win/meta and pointer/observation/launch tools; blocks type_text, Return, letters, and all chords before dispatching any input.
    • Preserves op.linuxWindow on NO_ACTIVE_WINDOW refusal while bypassing WINDOW_CHANGED for bare Escape/Super when active window is empty—preventing spurious WINDOW_CHANGED when returning to the original window while preserving cross-window protection.
  • apps/computer/local-daemon/README.md & Makefile:
    • Documented NO_ACTIVE_WINDOW alongside WINDOW_CHANGED and SCREEN_LOCKED in README.
    • Wired python3 -m unittest discover -s apps/computer/local-daemon/internal/linger/localtools -p '*_test.py' into check-computer-go (make check-computer & CI).
  • linux_guard_test.go & local_linux_guard_test.py: Full Go and Python unit test suites (with deterministic linuxSleep hook replacing wall-clock sleep racing).

Review Updates

  • Addressed P2-1 (direct errNoActiveWindow wrapping errNotSent, removed notSentError and extra finishDesktop branch), P2-2 (removed duplicate Python guard, Python 150ms sleep, and isNoActiveWindowError; single Go gate + single 250ms Go settle), P2-3 (removed dead gdbus fallback and tests), P2-4 (Makefile check-computer-go runs Python tests), P2-5 (README updated), P3-6 (deterministic linuxSleep hook in TestLinuxRunActionsSuperWaitsOverviewSettleBeforeType), and rebased onto latest main (29ad855e).

Verification

  • Python (unittest discover 6/6, py_compile, JSON-RPC initialize), Go (go vet, Go unit tests in localtools), and GOOS=linux GOARCH=amd64 cross-compile all PASS.
  • Pending Linux QA re-test on 118: Overview input guard and 30x run_actions [Super, type_text] under the single Go gate + 250ms settle.
  • Note: touches linux_native.go with a 1-line test seam alongside PR fix(computer): launch Linux apps in transient scope and surface launch errors (WHI-1047) #779; whichever merges second will have a trivial 1-line conflict to unify.

@linger-review linger-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve with nits (5 P2, 1 P3)

Scope: base main, merge base 53f7d21a; 1 commit, 5 files reviewed (linux.go, linux_native.go, local_linux.py and both new test files). Loaded ponytail-review. coderbook and karpathy-guidelines were not loaded, so their review criteria were applied from the review instructions only. Ran in a separate session.

The fix works. Go now refuses type_text/press_key when active-window is empty, both before the first step and between steps, and Python's active_window() returns "" while GNOME's Overview is open. The findings below are about the size of the change: a second error envelope, a second guard in the driver, and a fallback that can never run.

Findings

P2

  1. finishDesktop's new branch and notSentError copy toolError (linux.go:300, linux.go:427-444)

    • server.go:208 toolError already turns any error that wraps errNotSent into {"isError": true, ..., "structuredContent": {"outcome": "not_dispatched"}}. The rest of the package marks refusals the same way: fmt.Errorf("COMPUTER_...: %w", errNotSent) (for example cua.go:1546).
    • The new branch builds that envelope again with its own outcome mapping. It also changes every existing err != nil && state == nil path, such as WINDOW_CHANGED when readWindowState returns nil (linux_elements.go:77), from a Go error into this second format.
    • Fix: define errNoActiveWindow as fmt.Errorf("NO_ACTIVE_WINDOW: ...: %w", errNotSent) and return it as a Go error. Then delete notSentError and the new branch in finishDesktop (about 25 lines). The {"completed": false, "completed_steps": 0} report adds nothing beyond the error text.
  2. The driver repeats the guard, and Go matches its error text (local_linux.py:768, local_linux.py:795-800, linux.go:326)

    • Go's checkWindow and the between-step check already call the driver's active-window, which runs the same active_window() with the Overview check. native_action then runs it again before every type/key. That is a second D-Bus call plus xdotool per keystroke, and a second copy of the allowed-key list: OVERVIEW_ESCAPE_KEYS vs allowKeyWithoutActiveWindow.
    • When the driver refuses, it replies with status: "unsupported" and only prose. linuxAction therefore returns a plain error, not errNotSent, so the Agent sees outcome failed ("may have taken effect") for input that was never sent. Go then has to recognise the case with strings.Contains(err.Error(), "NO_ACTIVE_WINDOW:"). That keys behavior on human-readable text, which the repo rules forbid.
    • The settle also exists twice: 150 ms in Python and 200 ms in Go, so a batch waits 350 ms after Escape/Super.
    • Fix: drop the driver guard and the Python sleep. Keep one settle in Go, sized to the 100-300 ms delay the PR body describes. If a driver-side refusal must stay, give it a structured receipt status that linuxAction maps to errNotSent, and delete isNoActiveWindowError.
    • Not P1: both copies must pass, so if they drift the result is an extra refusal, never leaked input.
  3. The gdbus fallback can never run in production (local_linux.py:120-155)

    • It runs only when Gio is not importable. In that case missing is set (local_linux.py:547-550) and probe fails with "AT-SPI is unavailable" (local_linux.py:725). The driver never starts, so no action can reach gnome_overview_active.
    • The globals().get("Gio") indirection exists only for the tests.
    • Fix: call Gio/GLib directly, as screen_locked() does (local_linux.py:41-48). Delete the gdbus branch and its test (about 20 + 25 lines).
  4. The new Python tests never run (local_linux_guard_test.py)

    • No CI job or make target picks them up. The only Python unittest target is Makefile:139 (apps/desktop/packaging).
    • To support these tests, the production script also gained if __name__ == "__main__" gates and protocol = sys.stdout. These are harmless because the daemon runs the script with -c (linux_native.go:42), but they only pay off if the tests run.
    • Fix: add python3 -m unittest for this directory to make check-computer, or drop the file.
  5. The README does not document the new refusal (apps/computer/local-daemon/README.md:1075-1092)

    • The README documents WINDOW_CHANGED and SCREEN_LOCKED but not NO_ACTIVE_WINDOW: which inputs are refused with no active window or with Overview open, which bare keys are allowed, and the Overview settle.
    • This is Agent-visible failure behavior, so it belongs in the same PR.

P3

  1. Sleep-based race test (linux_guard_test.go:719-735)
    • TestLinuxF2RunActionsSuperWaitsOverviewSettleBeforeType relies on a 20 ms goroutine sleep finishing within a 50 ms settle. Under load the goroutine can be scheduled late, and the test fails without any code change.
    • Fix: flip the fake's active window from a hook on the settle sleep, or wait on a channel, instead of racing wall-clock time.

Verified as fine

  • The between-step check runs before the window-changed check, so [Super, type_text] stops with NO_ACTIVE_WINDOW and not a generic stop (linux.go:250 before linux.go:254).
  • A failed active-window read between steps now stops the batch instead of comparing against nil (linux.go:241-245).
  • A bare Escape/Super with an empty active window skips WINDOW_CHANGED, while a different non-empty window is still refused (linux.go:364-370). A NO_ACTIVE_WINDOW refusal skips observation, so op.linuxWindow is kept (linux.go:266-268; finishDesktop only overwrites it from a non-nil state).
  • The refusal releases the input journal as confirmed, so it does not block later input: finishDesktop passes confirmed = !errors.Is(err, errOutcomeUnknown) to lease.Finish.
  • The Go and Python key lists match after normalization: super/win/meta map to Super_L and esc maps to Escape (local_linux.py:561-565), and Go lowercases before comparing (linux.go:318).
  • The __main__ gates do not change production startup: the script runs via python3 -u -c (linux_native.go:42), where __name__ == "__main__".
  • linuxHost is a pure test seam with the same production value (linux_native.go:22).
  • No CJK in the added lines or the commit message, and no merge commits.
  • Unverified: the real GNOME timing for _NET_ACTIVE_WINDOW and OverviewActive. I relied on the PR's QA numbers, because the fakes cannot show it.

Process notes

  • The branch is 10 commits behind main, and main requires up-to-date branches, so it needs a rebase.
  • Commit a9db0ed4 is authored as yunhe <> with an empty email, so it is not linked to a GitHub account.
  • The PR body says this PR and WHI-1047 will conflict on one line in linux_native.go; whichever merges second must resolve it.

CI

  • All checks pass. check (computer-go) runs without -race and does not run the Python tests.
  • I ran all 13 tests in linux_guard_test.go with -race -count=1: pass (1.5 s).
  • I ran python3 -m unittest local_linux_guard_test: 9/9 pass.

Automated review by Claude Code


Automated review of a9db0ed by Claude Code.

@linger-review linger-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve with nits (1 P2)

Scope: base main, merge base 19cdc336, 1 commit, 7 files reviewed. Follow-up on a9db0ed; the branch was rebased, so the PR-only diff (19cdc336..b86983c) was compared with the earlier PR diff rather than a9db0ed..HEAD. Loaded coderbook, ponytail-review and karpathy-guidelines. Ran in a separate session.

Previous findings

  1. P2 duplicate toolError branch in finishDesktop: Resolved. errNoActiveWindow now wraps errNotSent (linux.go:292), and notSentError and the extra branch are gone.
  2. P2 duplicated Python guard plus text matching: Resolved. The Python guard, the 150 ms sleep and isNoActiveWindowError are gone. Go is the only gate.
  3. P2 unreachable gdbus fallback: Resolved. Only the Gio path is left (local_linux.py:111). The globals().get("Gio") guard stays only so the unit test can run without Gio, which is harmless.
  4. P2 Python tests not wired into CI: Resolved. Makefile:149. The check (computer-go) log shows Ran 6 tests ... OK.
  5. P2 README missing NO_ACTIVE_WINDOW: Resolved. See apps/computer/local-daemon/README.md:1094.
  6. P3 sleep-timed test: Resolved. TestLinuxRunActionsSuperWaitsOverviewSettleBeforeType now uses the linuxSleep seam to switch state deterministically.

Findings

P2

  • apps/computer/local-daemon/internal/linger/localtools/linux.go:248: when a mid-batch NO_ACTIVE_WINDOW refusal stops a batch after some steps already ran, the result says nothing was sent.
    • What happens: in runActions, when the step after a dispatched step needs a window and the active window is empty, the code sets err = errNoActiveWindow with done > 0. It then skips observation (state == nil), so finishDesktop returns the bare error. server.go:toolError sees errNotSent and reports structuredContent.outcome = "not_dispatched". The completed_steps/total_steps report and the window description are dropped.
    • Example: run_actions [type_text "hello", press_key Super, type_text "x"] with Overview opening after Super. "hello" and Super were both sent, but the structured outcome says the call was not dispatched. Code that treats not_dispatched as safe to resend would type "hello" twice. TestLinuxRunActionsSuperWaitsOverviewSettleBeforeType asserts this outcome after Super was sent.
    • Fix: keep the errNotSent refusal for the done == 0 precheck. Handle the mid-batch case like the other mid-batch stops: set stopped = "NO_ACTIVE_WINDOW: ..." and let the existing observe path return the steps that completed. Keeping op.linuxWindow is still possible by not overwriting it when the observed window is empty.

Verified as fine

  • The driver runs as python3 -u -c <program> (linux_native.go:42), so __name__ == "__main__". The new if __name__ == "__main__" guards around fd redirection, signal handlers and the RPC loop do not change behaviour in production.
  • gnome_overview_active uses NO_AUTO_START with a 300 ms timeout and returns False on any exception (local_linux.py:111-143), so non-GNOME desktops are not affected. active_window normalises X11 None ("0") to "".
  • checkWindow (linux.go:340) only refuses type/non-exempt key actions when the active window is empty. Bare Escape/Super can still get the Agent out of Overview. WINDOW_CHANGED still fires for a different non-empty window. Before any observation, pointer actions still skip the check.
  • The single-call refusal passes state == nil, so op.linuxWindow is kept (linux.go:110-112, and finishDesktop only updates it from state). The action journal is released through lease.Finish(true).
  • An inter-step active-window read failure now stops the batch instead of being ignored (linux.go:239-243).
  • go test -race -run Linux ./internal/linger/localtools passed locally.
  • There are no CJK characters in added lines or in the commit message.

Process notes

  • One commit. No merge or fixup commits. The merge base is the current main head. The PR is blocked only on required review.

CI

All checks pass, including check (computer-go), which now runs the Python unit tests. CI runs the daemon's Go tests without -race, so I ran the Linux guard tests locally with -race, and they passed.

Automated review by Claude Code


Automated review of b86983c by Claude Code.

@Kilyn544
Kilyn544 force-pushed the fix/whi-1046-linux-no-active-window-guard branch from b86983c to 4035b06 Compare November 26, 2026 13:05

@linger-review linger-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve with nits (1 P2)

Scope: follow-up on b86983c, reviewing head 4035b06 against main (merge base 19cdc336); 1 commit and 7 files reviewed, with the changes since b86983c (README, linux.go, linux_guard_test.go) read closely. I applied the review rules from the coderbook, ponytail-review (sections 1–3) and karpathy-guidelines (sections 2–3) skills directly; their files were not loaded separately in this run. The review ran in a separate session.

Previous findings (follow-up on b86983c)

  • Resolved: a mid-batch refusal was reported as not_dispatched. linux.go:248 now sets stopped = noActiveWindowStopped instead of returning errNoActiveWindow. linux.go:261-269 takes a desktop screenshot and reports completed_steps/total_steps with a stopped reason. TestLinuxRunActionsFocusedToEmptyStopsBeforeSubsequentTypeAndKey checks that only step 1 was sent, that the journal is not blocked, and that op.linuxWindow is kept.

Findings

P2

  • apps/computer/local-daemon/internal/linger/localtools/linux.go:417: finishDesktop now skips an empty state.windowID whenever op.linuxWindow is non-empty. get_window_state also goes through finishDesktop (linux.go:89-99), so this read can no longer update the window baseline to "no active window". The baseline stays on the old window even when the Agent's latest observation shows the desktop with no active window. Every later pointer input then fails checkWindow (linux.go:365: current == "", op.linuxWindow == A) with WINDOW_CHANGED. That error's window state is empty too, so the baseline stays at A.
    • Failure scenario (I reproduced it with a throwaway test on the PR's fake harness): observe gedit (16777348), the desktop goes to Overview, then call get_window_state. op.linuxWindow stays "16777348". Both following click calls return WINDOW_CHANGED and send 0 inputs.
    • The same happens after the alt+F4 path that TestLinuxRunActionsFocusedToEmptyStopsBeforeSubsequentTypeAndKey exercises when the closed window was the last one. The baseline points at a window that no longer exists, so a click on the dock or desktop is refused until the Agent happens to call screenshot (which sets op.linuxWindow directly at linux.go:77) or open_application. The error text ("act on it or bring back the window you meant") points the Agent toward retrying, not toward that recovery.
    • This also goes against the README's statement that pointer tools stay allowed while no window is active. TestLinuxNoActiveWindowAllowsPointerActions only covers op.linuxWindow = []byte{}.
    • Fix: keep the window-preservation rule for refused or stopped input only. The NO_ACTIVE_WINDOW paths already pass state == nil and skip the update (linux.go:110-112, 187-189, 261). So the extra condition in finishDesktop can probably be dropped, and an explicit observation would then record what it saw. Add a test for: observe A → Overview → get_window_state → click succeeds.

Verified as fine

  • The single gate in checkWindow (linux.go:357-369) refuses type_text and non-bare keys, including chords and Return, before any input when the active window is empty. Bare Escape/Super skip the WINDOW_CHANGED comparison only when the active window is empty (linux.go:362-364).
  • Single-step and first-step NO_ACTIVE_WINDOW refusals pass state == nil, so finishDesktop returns the bare error that wraps errNotSent (linux.go:110-112, 187-189, 424-426).
  • The inter-step pause uses overviewSettle only after a bare overview key, through the linuxSleep seam (linux.go:223-227). The test replaces wall-clock sleeps with that hook.
  • A failure to read the active window mid-batch now stops the batch instead of comparing an empty reply (linux.go:239-243).
  • The Python __name__ == "__main__" guards don't change runtime behavior: the daemon runs the program with python3 -u -c (linux_native.go:42), where __name__ is "__main__". gnome_overview_active reads the module-level Gio/GLib imported at local_linux.py:531 and returns False if they are missing or the D-Bus call fails.
  • The check-computer-go Makefile target now runs the Python unit tests, and CI's check (computer-go) passed with them.
  • No CJK characters in added lines or in the commit message, and no merge commits.

Process notes

  • The branch is 10 commits behind main, and main requires up-to-date branches, so it needs a rebase before merging.
  • Commit 4035b06 has author yunhe with an empty email, so it isn't linked to a GitHub account.

CI

All checks pass, including check (computer-go), check (computer-go-windows) and repository-gate. CI runs the Go tests without -race. This PR doesn't add goroutines or locks, so I didn't run a race pass. I ran one throwaway probe test (go test -run TestZZProbe on the localtools package, then deleted it) to reproduce the P2 above.

Automated review by Claude Code


Automated review of 4035b06 by Claude Code.

@Kilyn544
Kilyn544 force-pushed the fix/whi-1046-linux-no-active-window-guard branch from 4035b06 to 445303f Compare November 26, 2026 13:59

@linger-review linger-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve with nits (1 P2 carried over, 1 P3)

Scope: follow-up on 4035b06. Base main, merge base 19cdc336; 1 commit, 7 files reviewed (full merge-base diff plus the incremental diff 4035b06..445303f, which touches linux.go, linux_guard_test.go and the README). Helper skills coderbook, ponytail-review and karpathy-guidelines were used as the rubric. Ran in a separate session.

Previous findings

  • Not resolved: get_window_state keeps the stale window, so clicks are refused again and again (P2). finishDesktop still only adopts an observed window when it is non-empty or the stored one is already empty (linux.go:439). After the Agent observes window A and then opens the Overview, click reaches checkWindow (linux.go:387): "" != A → WINDOW_CHANGED. The readWindowState that follows returns an empty windowID, so op.linuxWindow stays A and every later click is refused until A becomes active again. The new commit makes this state more likely: a batch now always stops after a bare Super (linux.go:254), which leaves the Agent in the Overview. There, the "click a target window" advice in errNoActiveWindow gets refused. The README now documents the preserved window as intentional, but the stuck-click case isn't addressed.

Findings

P3

  • apps/computer/local-daemon/internal/linger/localtools/linux.go:336: isOverviewToggleKey repeats the super/super_l/super_r/win/meta list that allowKeyWithoutActiveWindow (linux.go:323) already has. If someone adds a key to one list and not the other, the "allowed without a window" rule and the "stop the batch" rule drift apart. Fix: have allowKeyWithoutActiveWindow match escape/esc and delegate the rest to one shared toggle-key check.

Verified as fine

  • The new toggle stop runs only when a next step exists and that step needs a window (linux.go:209 breaks on the last step before reaching linux.go:254). Bare Escape is excluded, so Escape → type_text inside a focused app still completes (TestLinuxRunActionsFocusedEscapeContinuesToNextType).
  • On a toggle stop, the report keeps the completed steps, captures only a screenshot, and passes state=nil. op.linuxWindow is preserved and the journal is not blocked (linux.go:268-276, TestLinuxRunActionsBareSuperAlwaysStopsEvenIfActiveWindowLags).
  • No code branches on the NO_ACTIVE_WINDOW text. The refusal path uses errors.Is(err, errNoActiveWindow), and errNoActiveWindow wraps errNotSent (linux.go:305). The stopped strings are only shown to the Agent.

Process notes

  • The branch is 17 commits behind main, which requires up-to-date branches, so it needs a rebase.
  • The author of commit 445303f3 (yunhe, empty email) is not linked to a GitHub account.

CI
All checks pass, including check (computer-go) and repository-gate. I also ran go test -count=1 -p 4 ./internal/linger/localtools -run Linux (pass) and the Python unittest discover for localtools (6/6 pass). I didn't run -race: the change adds no concurrency.

Automated review by Claude Code


Automated review of 445303f by Claude Code.

…empty active window

Refuse type_text and non-exempt press_key actions on Linux X11 when no application window is active or GNOME Shell's OverviewActive D-Bus property is true, preventing keystrokes from landing in the Activities Overview search box and reporting false-positive completion.

- Query org.gnome.Shell OverviewActive via in-process Gio/GLib session D-Bus (NO_AUTO_START, 300 ms timeout) in local_linux.py:active_window(), returning empty while Overview is open even when a single Escape restores _NET_ACTIVE_WINDOW to a background window, and normalizing X11 None ("0") to empty.
- Gate single-step actions and step 0 of run_actions in Go checkWindow with errNoActiveWindow wrapping errNotSent so server.go reports isError:true and outcome:not_dispatched without altering finishDesktop.
- When run_actions hits an empty active window mid-batch (done > 0) before a keyboard/text step—or immediately after a bare Super/Meta/Win overview toggle key regardless of compositor latency—stop cleanly via the existing stopped/report path (reporting completed_steps, total_steps, a screenshot, and NO_ACTIVE_WINDOW in stopped rather than outcome:not_dispatched) while preserving op.linuxWindow. Focused Escape sequences (such as Vim or dialogs) continue normally when the active window stays focused.
- Keep bare overview-dismiss/toggle keys (Escape, Esc, Super, Super_L, Super_R, win, meta) and pointer/observation/launch/semantic tools allowed while no window is active, preserve op.linuxWindow across NO_ACTIVE_WINDOW refusals and empty-window observations so returning to the previously observed window does not trigger WINDOW_CHANGED, and wait a single 250 ms settle pause in Go runActions after bare overview keys.
- Wire Python driver unit tests into Makefile check-computer-go, add deterministic Go and Python unit tests, and document NO_ACTIVE_WINDOW in apps/computer/local-daemon/README.md.
@Kilyn544
Kilyn544 force-pushed the fix/whi-1046-linux-no-active-window-guard branch from 445303f to 62dcc74 Compare November 26, 2026 18:38

@linger-review linger-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve (0 findings)

Follow-up on 445303f. Reviewed 62dcc74 against merge base 19cdc336 (1 commit, 7 files).

Previous findings

  • Resolved: the Super/Meta/Win key table was duplicated. Both callers now use isOverviewToggleKeyName (apps/computer/local-daemon/internal/linger/localtools/linux.go:322, :336, :348). The allowed key set is unchanged.

Verified as fine

  • The __name__ == "__main__" guards keep the driver working. The daemon runs the script as python3 -u -c <program> (linux_native.go:42), where __name__ is "__main__". So the protocol fd swap, the signal handlers and the RPC loop all still run in production.
  • gnome_overview_active() reads Gio/GLib from the module-level gi import (local_linux.py:531). If that import fails, the function returns False, so the guard falls back to the plain X11 check and does not crash.
  • finishDesktop only overwrites a non-empty op.linuxWindow with an empty window ID when the stored one is also empty (linux.go:442). This keeps the last observed window through the Overview, so returning to it does not trigger a spurious WINDOW_CHANGED.

CI: 6 checks passed (including repository-gate and teamhub). check (computer-go) and 8 others were still pending at review time. I ran go test -count=1 -p 4 ./internal/linger/localtools -run Linux (pass) and the Python unittest discover (6/6 pass) locally.

Automated review by Claude Code


Automated review of 62dcc74 by Claude Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant