Repository navigation
Conversation
…he agent can open what the user attached
Hermes stages file.attach uploads, pasted images and large Desktop pastes
under HERMES_HOME/{attachments,images,composer-pastes} and names the staged
file by its host path in the prompt (@file:). The sandbox hid HERMES_HOME
whole, so any attachment too large or binary to inline pointed at a path
that did not exist inside the sandbox, for terminal commands and file tools
alike, and an operator bind could not bring it back.
Each staging dir is now made if missing (as core does for docker) and bound
read-only at its own path among the late mounts, through the same bind
guard as the scratch dir: a staging dir that is a link into the rest of the
Hermes home or into a writable dir is refused with one warning. Read-only,
so a command cannot plant a file a later turn takes for an upload. The rest
of HERMES_HOME (config, .env, sessions, platform document caches) stays
hidden.
Version 1.5.2.
Fixes #430
This was referenced Nov 19, 2026
Contributor
Author
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.
Fixes #430 (reported by @albertoprb, whose diagnosis this follows).
Bug. A file attached in the TUI, Desktop or web (
file.attach) is staged at<profile HERMES_HOME>/attachments/<name>(tui_gateway/prompt_attachments.py_session_home_dir/_stage_session_file_attachment). Pasted images go toHERMES_HOME/imagesand large Desktop pastes toHERMES_HOME/composer-pastes. The prompt names that host path in an@file:reference. The bubblewrap sandbox hidesHERMES_HOMEwhole and bound back only the scratch dir, the state dir and the profile home. So an attachment too large or binary to inline pointed at a path that did not exist inside the sandbox, forterminaland for the file tools alike. An operatorbindsentry cannot work around it, because binds into a Hermes home are refused.Fix.
staged_input_bindscreates each of the three staging dirs if it is missing (core does the same for docker inget_cache_directory_mounts) and binds it read-only at its own path, among the late mounts next to the scratch dir. The dirs go through the same bind guard as the scratch dir, so a staging dir that is a symlink into the rest of the Hermes home, or into a directory a sandbox can write to, is refused with one warning. Read-only means a command cannot plant a file that a later turn would take for an upload. Everything else underHERMES_HOMEstays hidden: config,.env, sessions, and the document caches from messaging platforms.Trade-off to note. Commit ad47c61 (1.1.0) kept these dirs hidden so that one session's staged files would not show up in another session's sandbox. With this change, every sandbox of a profile can read that profile's staged chat input. Other profiles' homes stay hidden. That is the access the docker backend already gives (core mounts the same dirs read-only), and without it attachments do not work at all under bubblewrap.
attachments.storage: workspaceis still available for anyone who wants per-workspace staging.Tests (real bwrap, both HERMES_HOME layouts):
test_a_chat_attachment_staged_in_the_hermes_home_is_readable_not_writable: the file is staged after the sandbox is built.catandShellFileOperations.read_filesee it, a write into the dir fails, andHERMES_HOME/.envstays hidden. Fails on main in both layouts (2 failed).test_a_staging_dir_linked_into_the_rest_of_the_hermes_home_is_not_bound:attachments -> HERMES_HOME/sessionsdoes not expose the transcripts.Plugin suite on core v0.23.2: 621 passed, 1 skipped (local real bwrap 0.11.1; base: 617 passed, 1 skipped). Version 1.5.2.
Note: on core
main(502009cc) the plugin suite already fails 148 tests before and after this PR. Core changedBaseEnvironment._wrap_command(..., cwd_fallback=)and removedLocalEnvironment._recover_cwd(core 8f95f721 / e979ba31), soBubblewrapEnvironmentbreaks on every command there. That needs a separate fix.