Skip to content

feat(extensions): add host activity, managed window, and web tab icon capabilities - #1332

Merged
iruriQ merged 1 commit into
mainfrom
feat/host-extension-window-activity-capabilities
Nov 27, 2026
Merged

iruriQ merged 1 commit into
mainfrom
feat/host-extension-window-activity-capabilities

Conversation

@iruriQ

@iruriQ iruriQ commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds three general-purpose Host extension capabilities inspired by #1312, scoped strictly to Host/Shell/Web infrastructure (without bundling any concrete extension):

  1. Task & Notification Activity Summary + Harness Display Metadata (packages/shared-contracts, packages/host-runtime, packages/extension-backend):
    • ctx.activity?.read() (ExtensionActivitySnapshot) and ctx.harnesses?.describe(id) (ExtensionHarnessPresentation).
    • Lazy subscription on first activity.read() with automatic teardown when consumer backends stop or Host shuts down; skipped in SSH-hosted mode; metadata/rename updates never trigger cold history reads (app-server-host.projection-3.test.ts snapshotReads === 0 preserved).
    • Preserves parent Thread active state while subagents are running (deferredCompletion), retries transient snapshot read failures ([50, 150, 400] ms), and isolates IPC concurrency channels (settings: 4, activity: 4, harness: 16, window: 4).
  2. Managed Native Floating Window (apps/desktop-shell/src-tauri, crates/launcher, packages/extension-backend):
    • ctx.windows?.{available, clickThroughSupported, open, close, showHost} and injected window.codexhostWindow.{clickThroughSupported, startDragging, setHitRegions}.
    • Loopback-only fixed origin/path/query enforcement, minimal Tauri capabilities, automatic cleanup on extension disable/uninstall or Host exit.
    • Detects Linux Wayland (WAYLAND_DISPLAY / XDG_SESSION_TYPE=wayland), disables broken global-cursor click-through polling, exposes clickThroughSupported: false, and avoids reading outer_size() before window show on Linux.
  3. Web Tab Icon (Favicon) Contribution (packages/shared-contracts, apps/web-ui):
    • WebExtensionApi.tabIcon?.set(pngDataUrl | null) with <128 KiB PNG data URL validation, multi-extension ownership, and automatic restore on hide/release/uninstall.

UI Demo

No visual changes: adds Host extension backend services, managed native window support in Desktop Shell, and Web tabIcon API without bundling any extension UI.

Validation

  • Prettier + cargo fmt -- --check (crates/launcher, apps/desktop-shell/src-tauri): passed
  • Focused ESLint on touched TS/JS files: 0 errors
  • npx tsc -b packages/shared-contracts packages/extension-backend packages/host-runtime: passed
  • node tools/check-boundaries.mjs: 0 violations
  • Focused Vitest (extension-activity.test.ts, app-server-host.projection-3.test.ts, services.test.ts, windows.test.ts, tab-icon.test.mjs): 59/59 passed
  • packages/extension-backend/test/process.test.ts: 4/4 passed
  • cargo test --manifest-path crates/launcher/Cargo.toml: 162 passed, 0 failed
  • cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml: 40 passed, 0 failed

Refs #1312

@iruriQ
iruriQ merged commit 0d666bf into main Nov 27, 2026
5 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

2 participants