Repository navigation
fix(pet): load user pet spritesheets through the host and keep the pet above the app window - #3465
Merged
Merged
Conversation
…t above the app window Pet spritesheets never resolved (GCWing#3370). The webview read them with the filesystem plugin, whose scope requires a literal leading dot on unix while every XDG directory starts with one, so the read always failed with `forbidden path`. The host now serves the bytes through `load_agent_companion_pet_spritesheet`, confined to the managed companion directory: the request is canonicalized, must stay under that root (symlink escapes are rejected), must be a regular file, and is capped at 16 MiB. The filesystem-plugin scope keeps its dot-literal default instead of being widened to every hidden path under the home directory. The desktop pet disappeared behind the app's own page. Wayland compositors drop GTK's keep-above request, so the only stacking relationship the platform still guarantees is "above its parent": the pet window is now a GTK transient of the main window on Linux, and both show paths re-assert always-on-top so X11 keeps floating it above other applications too. Remote scenarios exercised: none. Both changes stay controller-local (`load_agent_companion_pet_spritesheet` is registered as LocalOnly / ControllerLocal / REFUSED).
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
Fixes #3370
User pet spritesheets never resolved: the webview read them with the filesystem plugin, whose scope requires a literal leading dot on unix while every XDG directory starts with one, so the read always failed with
forbidden path. The host now serves the bytes through a newload_agent_companion_pet_spritesheetcommand, confined to the managed companion directory: the request is canonicalized, must stay under that root (symlink escapes are rejected), must be a regular file, and is capped at 16 MiB. The filesystem-plugin scope keeps its dot-literal default instead of being widened to every hidden path under the home directory.The desktop pet also disappeared behind the app's own page. Wayland compositors drop GTK's keep-above request, so the only stacking relationship the platform still guarantees is "above its parent": on Linux the pet window is now a GTK transient of the main window, and both show paths re-assert always-on-top so X11 keeps floating it above other applications too.
Type and Areas
Type: bug fix
Areas: desktop/Tauri, web UI
Motivation / Impact
Imported user pets could never render on Linux (issue #3370), and the desktop pet could be covered by the application's own window. Users can now actually see the pet they imported, and the pet stays visible while the app window is focused or moved over it. Both changes remain controller-local:
load_agent_companion_pet_spritesheetis registered asLocalOnly/ControllerLocal/REFUSEDin the Product Operation Registry.Verification
pnpm run capabilities:check— passed (693 Tauri commands, registry artifacts regenerated from source).cargo check -p openbitfun-product-domains— passed.cargo test -p openbitfun-product-domains— 43 passed, includingremote_surface::tests::generated_registry_json_matches_compiled_registryandoperations_are_sorted_and_unique.pet_spritesheet_read_is_confined_to_the_companion_directoryandpet_spritesheet_read_rejects_a_symlinked_escape(unix).boba, 2.4 MB spritesheet):load_agent_companion_pet_spritesheetcompleted in 97 ms with no errors,forbidden pathno longer appears in the webview log, and the spritesheet rendered correctly. The companion window was created and shown with noalways-on-topor GTK-handle failures logged.Reviewer Notes
The pet spritesheet read is now controller-local by design; remote workspaces and peer hosts answer
REFUSEDfor this command rather than proxying it. The stacking fix is scoped to#[cfg(target_os = "linux")]and falls back to warn-only logging, so a stacking failure never blocks the pet from showing. The filesystem-plugin scope was intentionally left unchanged, so reverting this commit restores the previous behavior instead of widening API access.Checklist