6 Commits

Author SHA1 Message Date
Siddharth Balyan
8054696ad4 fix(models): fingerprint the executable a process provider actually launches
The catalog fingerprint resolved the profile's default process_command even
when a process_command_env_vars override picked another executable. An
upgrade that repointed an override symlink changed neither the override text
nor the default binary, so the picker kept the old executable's model list.
The launch path and the fingerprint now share external_process_command, so
both select the same command. Answers Greptile r4511687631 on #151817.
2026-11-09 18:06:44 +05:30
Teknium
b3252c2ad5 fix(left-core): refuse a moved provider's launch env on every home, not only without the plugin dir
P2-4 (r4 review ACP-2) and ACP-4. The env-writer launch denylist covered registered external-process
profiles plus a left-core row's profile_env only while the plugin DIR was absent, so a home with
plugins/github-copilot/ present but not loaded (disabled, failed to load, quarantined, safe worker)
accepted HERMES_COPILOT_ACP_COMMAND / HERMES_COPILOT_ACP_ARGS / COPILOT_CLI_PATH from the dashboard,
MCP/connector installs or save_env_value; the value runs as the ACP binary once the plugin loads. Core
refused them on every home before the split.

LeftCoreFeature gets a launch_env field (the executable/argv names), refused on every home
(launch_env_names); a loaded plugin's profile declares the same names. Reusing profile_env (the
profile-isolation list) as the security list had also newly refused COPILOT_ACP_BASE_URL, an address,
while the plugin was absent (ACP-4); it is writable again, as before the split.
2026-10-25 22:22:46 -07:00
Teknium
889d753725 feat(left-core): migration rows for a model provider that moved to a plugin
LEFT_CORE rows gain three generic fields for a model-provider plugin:

- providers: the ids and aliases the plugin's profiles register. A name
  nothing resolves to gets the install line appended on every "unknown
  provider" surface (runtime resolution / Desktop error text via
  auth.resolve_provider, /model, `hermes model`, `hermes auth add`);
  resolve_runtime_provider installs the plugin first for a home that uses it
  (the CLI and Desktop resolve the provider before the agent whose start runs
  the migration exists); and hermes_cli.providers.get_provider never lets the
  models.dev catalog stand in for such a name while the plugin is not loaded
  (models.dev lists `github-copilot` at api.githubcopilot.com with
  GITHUB_TOKEN: it would have sent a raw GitHub token there).
- profile_env: env names core kept profile-managed. env_loader's
  _PROFILE_MANAGED_ENV_KEYS and config._EXTRA_ENV_KEYS read them statically
  (env_loader runs before discovery), and the generic env writers refuse them
  while the plugin is absent (the executable/argv authority its profile
  declares once installed).
- notice: one more per-home sentence on every migration outcome.

First consumer: the github-copilot row (providers copilot + copilot-acp and
every alias). It is in use when copilot/copilot-acp is a provider the home
routes through: model, fallback chain, auxiliary tasks, delegation and its
fallback chain, MoA presets, cron job pins, auth.json active_provider, or
HERMES_INFERENCE_PROVIDER. A GH_TOKEN alone is not use. COPILOT_GITHUB_TOKEN
and the two base-URL overrides stay out of children as provider env (Tier 2),
as when core shipped Copilot. Its notice tells a profile with no token the
plugin reads (no COPILOT_GITHUB_TOKEN/GH_TOKEN/GITHUB_TOKEN, no `manual`
credential-pool row or providers.copilot login: a gh_cli pool row was seeded
from `gh auth token`) to run `hermes auth add copilot`; the plugin no longer
reads gh or the Copilot CLI's token files. Read-only, never runs gh.

The unknown-provider hint helper moves out of auth.py (over the size cap)
into auth_error_copy.unknown_provider_hint.
2026-10-25 20:47:10 -07:00
Teknium
cd4433dd0e refactor(acp): delegation.command and launch-env policy come from external_process profiles
A pinned delegation.command used to force provider "copilot-acp" whenever the selected
provider was not external_process. It now resolves the external_process profile whose
process_command names the same binary, else the profile flagged with the new
ProviderProfile.process_command_fallback (copilot-acp sets it, so every Copilot setup
resolves as before), else the spawn fails loudly. A kimchi binary now lands on kimchi-acp.

The env-writer denylist's hardcoded HERMES_COPILOT_ACP_* pair becomes
hermes_cli.auth_external_process.external_process_launch_env_names(): every registered
external_process profile's process_command_env_vars + process_args_env_var. This also
closes the gap for out-of-tree providers (KIMCHI_ACP_COMMAND/ARGS) and COPILOT_CLI_PATH,
which select the executable too.
2026-10-25 18:14:42 -07:00
Brooklyn Nicholson
865ba906c1 fix(auth): return the user-local external CLI as one native path on Windows
The user-local known dir is spelled %USERPROFILE%/.local/bin, so a Windows hit came back
with mixed separators in provider status and in the spawned ACP argv. Normalize the
resolved path.

Co-authored-by: Finn763 <165816600+finn763@users.noreply.github.com>
2026-10-07 14:19:47 -05:00
Brooklyn Nicholson
e894a7f82a refactor(auth): move external-process CLI lookup into auth_external_process to keep auth.py inside the size ratchet 2026-10-07 14:19:47 -05:00