Skip to content

fix(desktop): route profile tabs through active gateway - #89786

Closed
addelh wants to merge 2 commits into
NousResearch:mainfrom
addelh:fix/profile-tabs-active-gateway-89675
Closed

fix(desktop): route profile tabs through active gateway#89786
addelh wants to merge 2 commits into
NousResearch:mainfrom
addelh:fix/profile-tabs-active-gateway-89675

Conversation

@addelh

@addelh addelh commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route Sessions profile-tab selection through the currently active registered gateway
  • preserve legacy profile routing for genuinely unscoped and ambiguous inferred non-local descriptors
  • apply the same ownership rule to per-profile new-session actions

Why

After merged #89719, Bot Mode can switch agents on the Mac Mini because it calls the connection-aware ensureAgent(connectionId, profile) path. The profile squares at the bottom of Sessions still call legacy ensureGatewayProfile(profile), dropping the active gateway identity.

That leaves an explicit local/registry-backed Sessions workspace unable to switch profiles even though the same profiles work from Bots.

The routing rule is deliberately bounded:

  • explicit registry descriptors use (connectionId, profile);
  • connectionId === "local" is authoritative even on the legacy primary descriptor, so This device cannot inherit a v1 remote override;
  • inferred non-local legacy IDs remain on the v1 profile path until Electron can prove exact registry identity;
  • descriptors with no connection ID remain byte-identical legacy behavior.

Fire-and-forget tab actions contain and log registry activation rejections, preserving the existing non-throwing UI contract instead of producing an unhandled promise rejection.

Relationship to other work

Related to #89675 and merged #89719.

This addresses the remaining Sessions profile-rail routing failure reported after Bot selection began working. It does not claim to replace #89609's activation-verdict work or #81165's failed-dial error surfacing.

Tests

TDD / mutation proof:

  • before the change, the registered-local profile-tab test failed because prepareGatewayForAgent("local", "research") was never called;
  • reverting both changed call sites makes the two registered-routing tests fail again;
  • restoring the fix returns the boundary suite to green.

Validation on Windows 11:

profile/profile-agent/connections suites: 43 passed
profile routing boundary tests:          5 passed
typecheck (renderer/electron/e2e):        passed
focused ESLint:                           clean

The full src/store sweep produced 993 passes and one unrelated timeout in session-unread-tile.test.ts; rerunning that file alone passed 3/3.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) area/profiles Multi-profile isolation, HERMES_HOME scoping labels Aug 19, 2026
…ve-gateway-89675

# Conflicts:
#	apps/desktop/src/store/profile.test.ts
#	apps/desktop/src/store/profile.ts
@addelh

addelh commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by merged #89785 (5d3c15aaa on current main), which reverts the atomic-publish activation series and was field-confirmed to restore profile switching. That merge changed the underlying profile.ts / gateway.ts seams and made this PR conflict; keeping another competing profile-switch patch open would add noise rather than help resolution.

Closing without deleting the branch. If profile tabs still fail after testing current main—especially on an explicit non-local registered gateway—we can re-cut the narrow connection-identity fix against the restored seams with fresh evidence. For the reported Mac Mini local-profile failure, #89785 is now the correct fix to verify.

@addelh addelh closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/profiles Multi-profile isolation, HERMES_HOME scoping comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants