feat(profile): surface in-app routing controls - #61205
konsisumer wants to merge 1 commit into
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment (new routing UI feature)
This PR adds in-app routing controls for profiles in the desktop app. While the changes look well-structured, the addition of 17 files with a new UI surface warrants human review before merge.
Looks Good
- Clean React component structure with providers
- Token input uses
type=passwordfor security - Multi-language support extended (en, ja, zh, zh-hant)
Flag
- New routing control UI is a user-facing feature — ensure it is tested across locales and edge cases (empty token, invalid token format)
|
Rebased onto current main and fixed the desktop TypeScript error in the profile-create dialog by removing the redundant always-true bridge guard. Local verification: the bounded Python suite and Windows-footgun scan passed. Desktop typecheck/build could not be rerun because npm dependency installation cannot complete without registry access in this sandbox. |
e819041 to
e3c51d1
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for consolidating the slash-command behavior and preserving the desktop-native /profile <name> routing path. The premise is real on current main: cli.py:8468 drops slash arguments and gateway/slash_commands.py:329-342 is status-only.
Problems
apps/desktop/src/app/profiles/create-profile-dialog.tsx:101-106permits the advertised blank-token path, butapps/desktop/electron/main.ts:5550-5555rejects token-auth remotes without a token. SincecreateProfile()runs first at PR line 79, this leaves a newly-created local profile after the save fails.- #44413 remains incomplete through Manage Profiles:
apps/desktop/src/app/profiles/index.tsx:245invokes a separate dialog defined at:477-600, which has no remote-backend controls.
Suggested changes
- Require a token before creating a token-auth remote, or implement auth-mode/OAuth setup and validate before creating the profile; add failure-path coverage.
- Reuse the shared dialog from the Manage Profiles flow and cover both entry points.
- Update
website/docs/reference/slash-commands.md:123for the new slash subcommands.
Automated hermes-sweeper review.
| @@ -82,6 +97,16 @@ export function CreateProfileDialog({ | |||
| await updateProfileSoul(trimmed, soul) | |||
| } | |||
|
|
|||
| if (backendMode === 'remote') { | |||
| await window.hermesDesktop?.saveConnectionConfig?.({ | |||
| mode: 'remote', | |||
There was a problem hiding this comment.
This permits an empty token even though the placeholder says users can sign in later, but token-auth saves reject it in apps/desktop/electron/main.ts:5550-5555. Since createProfile() has already completed before this call, the failure leaves a local profile behind. Require a token here or support an OAuth/staged setup before creating the profile.
|
Thanks for the review. Addressed in this push:
The full Python suite could not collect here because FastAPI/Uvicorn are unavailable and the sandbox disallows its dependency install. |
e3c51d1 to
b15f2db
Compare
b15f2db to
3976519
Compare
|
Rebased onto current main and resolved the gateway Verified: focused profile and gateway status coverage (22 passed), Ruff on changed Python files, Windows footguns scan, and |
|
Rebased onto current main and retained the shared console |
3976519 to
a6eb886
Compare
|
Closing — |
What does this PR do?
Adds a shared in-session profile command model and exposes backend targeting in the desktop profile-create flow so users can discover profile switching and remote-profile routing without leaving the app.
Related Issue
Type of Change
Shared root cause
hermes profile use) and separate/hidden desktop gateway overrides. The desktop rail could switch per-session profile backends, but the in-session/profilecommand outside desktop was read-only, and the profile+flow only created a same-backend profile with no hint that a profile can route to another backend.How this fixes each issue
/profilenow supportslist,switch <name>, anduse <name>from active CLI/gateway/console sessions, updates slash metadata for discoverability, and keeps desktop/profile <name>for per-session routing while passing/profile switch <name>through to the backend sticky-default command.+creates a profile on the *current* backend #44413: the shared desktop create-profile dialog now includes a Backend target selector. Users can create a normal local profile or enter a remote backend URL/session token during creation, which saves the existing per-profile connection override immediately instead of requiring a disconnected trip through Gateway settings.Changes Made
hermes_cli/profile_slash.pyas the shared status/list/switch implementation for in-session profile commands.hermes profile switchparser alias to the shared behavior.list/switch/useprofile subcommands reach the backend, while/profile <name>remains the desktop-native per-session profile switch.apps/desktop/src/app/profiles/create-profile-dialog.tsxusing the existingsaveConnectionConfigper-profile override API.How to Test
pytest tests/cli/test_profile_slash.py tests/cli/test_cli_status_command.py tests/gateway/test_status_command.py -q --timeout=60pytest tests/cli/test_profile_slash.py tests/cli/test_cli_status_command.py tests/gateway/test_status_command.py tests/hermes_cli/test_profiles.py::TestActiveProfile -q --timeout=60ruff checkon changed Python filespython -m py_compile hermes_cli/profile_slash.py hermes_cli/cli_commands_mixin.py gateway/slash_commands.py hermes_cli/console_engine.py hermes_cli/subcommands/profile.py hermes_cli/main.py/opt/homebrew/bin/timeout -k 30 480 sh -c 'pytest tests/ -q -x --timeout=60 "$@"' shaborted during collection becausefastapi/uvicornare missing and lazy pip install is blocked by the externally managed Python environment.npm run test:ui -- src/app/session/hooks/use-prompt-actions/index.test.tsxandnpm run typecheckcould not run becausevitestandtscare not installed in this worktree.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass: full collection is blocked by missing dashboard deps in this environment; targeted changed-path tests passDocumentation & Housekeeping
cli-config.yaml.example: N/ACONTRIBUTING.md/AGENTS.md: N/AScreenshots / Logs
Not included; local desktop JS tooling was unavailable in this worktree.
This coordinated PR bundles a fix that spans several issues. Happy to split it back into focused per-issue PRs if you'd prefer to review them separately.
Refs #44063
Refs #44413