Skip to content

fix: repair build cache preflight and hide companion bubbles on focus - #3272

Merged
GCWing merged 2 commits into
mainfrom
gcwing/ship-build-cache-and-pet-focus
Oct 2, 2026
Merged

GCWing merged 2 commits into
mainfrom
gcwing/ship-build-cache-and-pet-focus

Conversation

@GCWing

@GCWing GCWing commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Repairs two build-cache defects and one Agent companion interaction issue:

  • check:build-prereqs now detects 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 does not repair that state, so --fix removes the broken
    directories first, guarded so a repair can never delete anything outside the
    virtual store.
  • The mobile-web rebuild cache watched a hand-written list of design-system
    sources, so a change under design-system/packages/ui or a package-root file
    such as vite.config.ts could leave src/mobile-web/dist stale while the
    build still reported success. It now watches the design-system/packages/
    and design-system/tooling/ trees (generated dist/ and node_modules/
    stay ignored), and the contract test runs in CI.
  • The Agent companion pet hides its bubbles while the main window is focused.
    The main window forwards focus changes as
    agent-companion://main-window-state; the pet keeps its bubble list empty
    while 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:

  • A package directory that pnpm records but leaves empty makes every nested
    tool invocation fail with an error that points at the bin shim rather than at
    the real cause.
  • A stale src/mobile-web/dist silently serves an old mobile bundle, and small
    viewport 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 passed
  • node --test scripts/check-build-prereqs.test.mjs -> 10 passed
  • pnpm run lint:web -> 0 errors (9 pre-existing warnings)
  • pnpm run type-check:web -> passed
  • pnpm --dir src/web-ui exec vitest run src/app/components/AgentCompanionDesktopPet -> 21 passed
  • pnpm run check:github-config -> GitHub YAML audit passed for 15 files

Not 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.mjs reports 3 failures on
a clean origin/main checkout in this environment (release/beta workflow
assertions 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

  • This PR does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable. (No user-visible strings added; companion copy is unchanged.)

GCWing 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.
@GCWing
GCWing merged commit 3f59065 into main Oct 2, 2026
25 of 27 checks passed
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