All plugins

url-date-slash-restore

Fix broken links in the final reply: when the model rewrites a URL copied from a tool result (e.g. date slashes turned into hyphens, /2026/11/17/ -> /2026-11-17/, so the link 404s), restore the exact source URL. Replaces only on a unique match; logs every change to a local jsonl.

Harry-2546Toolsv0.1.0Updated 8 days ago

About

Fix broken links in the final reply: when the model rewrites a URL copied from a tool result (e.g. date slashes turned into hyphens, /2026/11/17/ -> /2026-11-17/, so the link 404s), restore the exact source URL. Replaces only on a unique match; logs every change to a local jsonl.

url-date-slash-restore

Repairs links that the model breaks while copying them into its reply.

Why

I kept getting 404s from links the agent posted. The tool results always had
the right URL and the session store had the right bytes, but the final reply
contained paths like /2026-11-17/ where the source said /2026/11/17/. The
model normalized a date-shaped path segment to an ISO date in the middle of
transcription. It happens inside the model: a URL arriving in a tool message is
enough to trigger it, and I reproduced the same rewrite with bare HTTP requests
against the model directly (qwen3.8-flash-next served by vLLM; other models
may do the same), so no pipeline-level check can catch it. Only date-shaped
segments are affected: ordinary multi-segment paths, version numbers and URLs
that natively use hyphenated dates came through intact in the same tests.

How it works

Two hooks, both documented Hermes surfaces:

  • post_tool_call collects every URL from this session's tool results into an
    in-memory index. Tool results are not modified.
  • transform_llm_output runs just before the final reply is delivered. If a
    URL in the reply is not one of the indexed sources but matches exactly one
    of them once you treat / and - as the same character, it is swapped back
    to the source text.

The exact-one-match condition is the point. A URL that matches no source, or
more than one, stays exactly as the model wrote it. The plugin only ever
copies real source text back; it never edits a URL toward a spelling it thinks
is more likely. Non-URL text and prose dates are untouched. Every replace or
ambiguity is appended as one JSON line to
plugin-data/url-date-slash-restore/repairs.jsonl so you can see what changed.

Limits

Final replies only. Tool call arguments, mid-turn text, and thinking streams
are not rewritten. The index lives in memory, so tool results from before a
process restart are not covered. Only the first 2,000,000 characters of each
tool result are indexed.

Install

hermes plugins install url-date-slash-restore
hermes plugins enable url-date-slash-restore

Enabling asks for the tools.override capability once (the output transform
needs it). If you deny it, the plugin loads, does nothing, and logs a warning
that says how to fix that. To turn it off without uninstalling, set
URL_DATE_SLASH_RESTORE_DISABLE=1.

Checking it works

Ask the agent to fetch a page whose URL has slash date segments (news
archives, blog posts) and to repeat the link. Then look at the audit log:

cat ~/.hermes/plugin-data/url-date-slash-restore/repairs.jsonl

repaired events are corrections it applied; ambiguous events are URLs it
left alone on purpose.

What it touches

  • In-process, through the two hooks only. Nothing in Hermes core is patched.
  • Reads tool result text in memory for URL extraction. The index is capped at
    200 sessions and 20k URLs per session and is cleared on restart.
  • Writes the local audit file described above (timestamps, session ids, URLs
    before and after). No telemetry, no network calls, no credentials.
  • At most one INFO log line per hook call (tool name, session id and counts,
    never URL text).

Tests

python tests/test_url_date_slash_restore.py   # or: pytest tests/

18 cases, no Hermes runtime needed.

License

MIT

README from the reviewed commit 0ca92f3; it updates when the author re-pins.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section