Repository navigation
fix: admit Discord attachments from the Hermes profile cache - #306
Merged
Merged
Conversation
A dedicated gateway profile caches inbound Discord media under its own
home while the process HERMES_HOME still names the base Hermes home, so
intake refused every image the captain pasted and recorded it only in
skipped_attachments, which nothing showed.
The plugin now records the Hermes home it was loaded for at registration
and passes it to every Firstmate subprocess as FM_EXT_HERMES_HOME, which
the attachment cache-root allowlist prefers over the process HERMES_HOME.
The allowlist stays exactly as strict: only that home's
cache/{images,audio,documents} and populated legacy *_cache dirs, regular
files, no symlinks, no widening to all of ~/.hermes.
The wake drain's EXT REQUESTS section now prints each refused attachment
with its name and reason, so a lost image is visible before Firstmate
answers the request.
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
Images the captain pastes in Discord reach Firstmate even when the gateway serves a profile, and a refused attachment is named in the drain instead of vanishing.
flowchart LR A[Discord image] --> B["profile cache/images"] C[plugin register] --> D["intake env: FM_EXT_HERMES_HOME"] B --> D D --> E{inside that home's caches?} E -->|yes| F[state/ext-attachments/slug] E -->|no| G["skipped_attachments: name, reason"] G --> H["drain: Rejected attachment: ..."]The plugin records the Hermes home it was loaded for at registration and passes it to every Firstmate subprocess as
FM_EXT_HERMES_HOME.The cache-root allowlist prefers that home over the process
HERMES_HOMEand stays exactly as strict: only itscache/{images,audio,documents}and populated legacy*_cachedirectories, regular files only, no symlinks, no widening to all of~/.hermes.Evidence
HERMES_HOMEat the base home and the image cached under<base>/profiles/fmcomms/cache/images, the new plugin case stagedbase.webpand recorded the captain'simg_1700.webpas{"reason":"uncached"}; the drain printed only thread and history lines.After: the same fixture stages
0-img_1700.webpintostate/ext-attachments/<slug>/, lists it underattachments, still refusesbase.webpand a CDN URL asuncached, and the drain printsRejected attachment: remote.png (reason: uncached).env -u FM_TASK_ID bash bin/fm-test-run.shover the 14 ext/plugin scripts (bridge, plugin-dest, media, ask, decision, watch, thread-context, ack-guard, inbox-remove, needs-you-buttons, bot-identity, topic-threads, waiting-pin, hermes-sandbox): 0 failed.bash bin/fm-lint.sh: clean at the pinned ShellCheck 0.11.0.Merge Danger
Door: two-way. Reverting restores the previous environment precedence and removes one printed drain line; no data, config, or state migration.
Blast Radius: narrow. Only gateway attachment staging and the drain's EXT REQUESTS output change; the allowlist's path, symlink, regular-file, and byte/count guards are untouched.
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
TMPDIR="$PWD/.validation-ext/tmp" bash tests/fm-ext-bridge.test.shTMPDIR="$PWD/.validation-ext/tmp" bash tests/fm-ext-plugin-dest.test.shTMPDIR="$PWD/.validation-ext/tmp" bash tests/fm-ext-bot-identity.test.shTMPDIR="$PWD/.validation-ext/tmp" bash tests/fm-ext-media.test.shExecuted evidence/live_driver.py through bin/fm-hermes-sandbox.sh using a disposable Hermes SDK environment, real plugin discovery, synthetic MessageEvents, intake, and wake drain.Read the documentation changes and compared changed paths; no changes under .omp/extensions/.Verified child completion, removed the disposable environment, and confirmed a clean working tree.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.