fix: repair build cache preflight and hide companion bubbles on focus - #3272
Merged
Merged
Conversation
added 2 commits
October 2, 2026 20:11
…ild inputs check:build-prereqs now reports a pnpm virtual store package whose directory exists but holds no files (or whose link target is gone): the matching node_modules/.bin shim then resolves to a path without content and nested tools fail with a confusing "Cannot find module .../bin/<tool>" error. pnpm install alone does not repair that state, so --fix removes the broken directories first, guarded so a path can never escape the virtual store. The mobile-web rebuild cache watched a hand-written list of design-system sources, so a change under packages/ui or a package-root config such as vite.config.ts could leave src/mobile-web/dist stale while the build looked successful. Watch the design-system packages/ and tooling/ trees instead, which covers new packages and package-root configs without maintenance, while generated dist/ and node_modules/ stay ignored. The contract test now runs in CI so the cache rules cannot regress silently.
The main window now forwards its focus changes as agent-companion://main-window-state, and the pet window keeps its bubble list empty while that flag is set, so the companion overlay no longer covers the session it points at while the user is working in the main window. The dock layout effect follows the same list, so the pet window resizes back to the pet alone, and the bubble list is memoized so a focused main window does not hand the effect a fresh array identity on every render. The new listener joins the existing readiness handshake, so agent-companion://ready is only emitted once every listener is attached.
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
Repairs two build-cache defects and one Agent companion interaction issue:
check:build-prereqsnow detects a pnpm virtual store package whose directoryexists but holds no files (or whose link target is gone). The matching
node_modules/.binshim then resolves to a path without content, and nestedtools fail with a confusing
Cannot find module .../bin/<tool>error.pnpm installdoes not repair that state, so--fixremoves the brokendirectories first, guarded so a repair can never delete anything outside the
virtual store.
sources, so a change under
design-system/packages/uior a package-root filesuch as
vite.config.tscould leavesrc/mobile-web/diststale while thebuild still reported success. It now watches the
design-system/packages/and
design-system/tooling/trees (generateddist/andnode_modules/stay ignored), and the contract test runs in CI.
The main window forwards focus changes as
agent-companion://main-window-state; the pet keeps its bubble list emptywhile that flag is set and resizes back to the pet alone, so the overlay no
longer covers the session the user is working in.
Type and Areas
Type: bug fix (build tooling/CI), behavior fix (web UI Agent companion)
Areas: build scripts + CI, Web UI (Agent companion desktop pet)
Motivation / Impact
Both build-cache defects cost real debugging time:
tool invocation fail with an error that points at the bin shim rather than at
the real cause.
src/mobile-web/distsilently serves an old mobile bundle, and smallviewport work was the first thing to notice.
No direct user-facing change for the first two. The Agent companion change is
user-visible on Desktop: bubbles stay out of the way while the main window has
focus and reappear when it loses focus.
Verification
node --test scripts/mobile-web-build.test.mjs-> 7 passednode --test scripts/check-build-prereqs.test.mjs-> 10 passedpnpm run lint:web-> 0 errors (9 pre-existing warnings)pnpm run type-check:web-> passedpnpm --dir src/web-ui exec vitest run src/app/components/AgentCompanionDesktopPet-> 21 passedpnpm run check:github-config-> GitHub YAML audit passed for 15 filesNot run: any GUI/visual check of the pet window on Desktop; the companion change
is covered by the component tests and the window-focus wiring only.
Note for reviewers:
scripts/check-github-config.test.mjsreports 3 failures ona clean
origin/maincheckout in this environment (release/beta workflowassertions unrelated to this PR); the audit script that CI runs passes.
Reviewer Notes
The two build-cache fixes and the companion change are independent; they are
bundled because they came from the same working tree. Files do not overlap, so
either part can be dropped without touching the other.
Checklist