fix(tui-gateway): scope MCP discovery to active profile - #72135
fix(tui-gateway): scope MCP discovery to active profile#72135LionGateOS wants to merge 3 commits into
Conversation
Related: #67623 and superseded predecessor #42794. The current diffs are not redundant: this PR binds the selected profile before starting discovery and propagates its HERMES_HOME into the discovery thread, while #67623 has broader secret-scope changes. Maintainer decision needed on the intended consolidated mechanism. |
6b3c71b to
c35a5bd
Compare
|
Thanks for reviewing. I agree the mechanisms overlap but target different
concerns. This PR focuses specifically on ensuring MCP discovery runs under
the selected profile's context, including the correct HERMES_HOME
propagation. I'm happy to adapt if maintainers prefer consolidating with
#67623.
…On Sun, Jul 26, 2026 at 2:42 PM Siddharth Balyan ***@***.***> wrote:
*alt-glitch* left a comment (NousResearch/hermes-agent#72135)
<#72135 (comment)>
*This was generated by AI during triage.*
Related: #67623 <#67623>
and superseded predecessor #42794
<#42794>. The current
diffs are not redundant: this PR binds the selected profile before starting
discovery and propagates its HERMES_HOME into the discovery thread, while
#67623 <#67623> has
broader secret-scope changes. Maintainer decision needed on the intended
consolidated mechanism.
—
Reply to this email directly, view it on GitHub
<#72135?email_source=notifications&email_token=AXOQMVUOXB7D6WQW646VIVT5GZGLFA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBYGQ4DMNZWGMZ2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5084867633>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXOQMVVZEKOD6PXIONSHDVL5GZGLFAVCNFSNUABGKJSXA33TNF2G64TZHMYTAMRUGU2TIMRWG45US43TOVSTWNBZHAYTSOBRGY4TLILWAI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
…y owner; restore stdio startup + WSTransport tests Follow-up to @LionGateOS's #72135 salvage: - Route ensure_mcp_discovery_started through hermes_cli.mcp_startup's shared owner instead of a hand-rolled bare thread, keeping the start lock, retry-after-zero-connected allowance, and interactive-OAuth suppression. The shared owner now captures the caller's context-local HERMES_HOME override and re-installs it inside the discovery thread, so discovery reads the selected profile's mcp_servers (#67605). - Restore stdio TUI startup discovery in main() and the _mcp_discovery_enabled retry gate in wait_for_mcp_discovery, both dropped by the original branch. - Restore the 3 WSTransport regression tests (send serialization, cross-batch ordering, drained-token ordering) deleted by the PR. - Harden the profile-scoped discovery test against sibling-state leaks.
|
Merged via PR #72219 — your three commits were cherry-picked onto current main with your authorship preserved in git log (rebase-merge). Thanks for the fix! Follow-up hardening added on top: discovery now routes through the shared owner in #67605 stays open for the remaining halves (secret scope, |
|
Thank you for the review and for carrying this through. I'm glad the
profile-scoped MCP discovery fix made it into main. The follow-up changes
around the shared discovery owner and restored startup paths make sense,
and I appreciate the additional hardening.
I'll keep an eye on the remaining #67605 items as they move forward.
…On Sun, Jul 26, 2026 at 5:14 PM Teknium ***@***.***> wrote:
Closed #72135 <#72135>.
—
Reply to this email directly, view it on GitHub
<#72135?email_source=notifications&email_token=AXOQMVWMRPP2RZNNSZKKTML5GZYEDA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOBVGA3TONJUGI2TFJTSMVQXG33OUZQXK5DIN5ZKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#event-28507754252>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXOQMVWVLU3LB7POAFMODQD5GZYEDAVCNFSNUABGKJSXA33TNF2G64TZHMYTAMRUGU2TIMRWG45US43TOVSTWNBZHAYTSOBRGY4TLILWAI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Thanks for carrying this through and preserving authorship. I appreciate the consolidation into #72219 and the additional hardening around the shared MCP discovery owner and profile-scoped HERMES_HOME propagation. I'll treat the remaining #67605 items as separate follow-up areas and avoid duplicating existing work. |
…y owner; restore stdio startup + WSTransport tests Follow-up to @LionGateOS's NousResearch#72135 salvage: - Route ensure_mcp_discovery_started through hermes_cli.mcp_startup's shared owner instead of a hand-rolled bare thread, keeping the start lock, retry-after-zero-connected allowance, and interactive-OAuth suppression. The shared owner now captures the caller's context-local HERMES_HOME override and re-installs it inside the discovery thread, so discovery reads the selected profile's mcp_servers (NousResearch#67605). - Restore stdio TUI startup discovery in main() and the _mcp_discovery_enabled retry gate in wait_for_mcp_discovery, both dropped by the original branch. - Restore the 3 WSTransport regression tests (send serialization, cross-batch ordering, drained-token ordering) deleted by the PR. - Harden the profile-scoped discovery test against sibling-state leaks.
…y owner; restore stdio startup + WSTransport tests Follow-up to @LionGateOS's NousResearch#72135 salvage: - Route ensure_mcp_discovery_started through hermes_cli.mcp_startup's shared owner instead of a hand-rolled bare thread, keeping the start lock, retry-after-zero-connected allowance, and interactive-OAuth suppression. The shared owner now captures the caller's context-local HERMES_HOME override and re-installs it inside the discovery thread, so discovery reads the selected profile's mcp_servers (NousResearch#67605). - Restore stdio TUI startup discovery in main() and the _mcp_discovery_enabled retry gate in wait_for_mcp_discovery, both dropped by the original branch. - Restore the 3 WSTransport regression tests (send serialization, cross-batch ordering, drained-token ordering) deleted by the PR. - Harden the profile-scoped discovery test against sibling-state leaks.
…y owner; restore stdio startup + WSTransport tests Follow-up to @LionGateOS's NousResearch#72135 salvage: - Route ensure_mcp_discovery_started through hermes_cli.mcp_startup's shared owner instead of a hand-rolled bare thread, keeping the start lock, retry-after-zero-connected allowance, and interactive-OAuth suppression. The shared owner now captures the caller's context-local HERMES_HOME override and re-installs it inside the discovery thread, so discovery reads the selected profile's mcp_servers (NousResearch#67605). - Restore stdio TUI startup discovery in main() and the _mcp_discovery_enabled retry gate in wait_for_mcp_discovery, both dropped by the original branch. - Restore the 3 WSTransport regression tests (send serialization, cross-batch ordering, drained-token ordering) deleted by the PR. - Harden the profile-scoped discovery test against sibling-state leaks.
Summary
Fixes profile-scoped MCP discovery so MCP startup happens after the selected profile HERMES_HOME is bound.
Changes
Testing
Supersedes #42794.