Repository navigation
fix(desktop): send session_id to shell.exec on Hermes main - #45
Merged
Merged
Conversation
Hermes main serves the session-scoped shell.exec, which refuses a call without session_id as invalid_params, so the probe never ran (#44). Send the focused session id and retry bare once when the scoped call is refused, for older backends whose sidecar shell.exec rejects session_id. A refusal is now labelled "shell.exec refused: <reason>" and ends the interpreter/path search instead of repeating for every candidate. With no focused session on Hermes main, the error says to open a chat. Fixes #44
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 #44. Thanks to @sand01chi for the root-cause analysis.
On Hermes main the Desktop socket serves the canonical, session-scoped
shell.exec(gateway/session_shell.py). It refuses a call withoutsession_idwithinvalid_params, so the probe never started and the page showed no cards.Changes
shellExec()helper: sends{ command, session_id }using the focused session, then retries once with{ command }if the call is refused withinvalid_params/extra_forbidden. Older backends with the sidecarshell.execrejectsession_id.shell.exec refused: <reason>and stops the interpreter/path search. Before, it repeated for every candidate.catalog/desktop/plugin.js.Tests
test_shell_exec_session.cjscovers the canonical, sidecar, no-session and other-refusal cases for both plugin copies.node --test *.cjs: 87 pass, 1 skipped.pytest: 104 pass.