hermes-agent/hermes_cli
Xue-1997 bd56440f4c perf(models): cache GitHub Copilot model catalog for 5 minutes
The picker path fetches the Copilot /models catalog multiple times per
process (list_authenticated_providers -> provider_model_ids ->
_fetch_github_models, plus get_copilot_model_context / normalize
helpers). Cache the filtered catalog at module level with a short TTL
so repeated picker opens do not pay a TLS handshake each time.

Fold-fixes on top of the original patch:
- key the cache by api_key so a mid-process credential swap never
  serves the previous account's catalog
- use time.monotonic() so wall-clock adjustments cannot extend the TTL
- deep-copy on store/serve so callers cannot mutate cached entries
- tests updated to patch _urlopen_model_catalog_request (main routes
  catalog fetches through open_credentialed_url now), plus TTL-expiry
  and credential-change coverage

Extracted from #40276.
2026-08-03 13:47:03 +05:30
..
dashboard_auth
observability
proxy
subcommands
web_routers
__init__.py
_early_recovery.py
_parser.py
_scan_venv_blockers.py
_startup_fast.py
_subprocess_compat.py
active_sessions.py
agent_import.py
approval_mode.py
approvals_suggest.py
auth.py
auth_commands.py
azure_detect.py
backup.py
bang_shell.py
banner.py
blueprint_cmd.py
browser_connect.py
build_info.py
bundles.py
callbacks.py fix(approval): classify CLI/TUI approval timeouts separately from explicit denials 2026-08-02 20:21:59 -07:00
checkpoints.py
claw.py
cli_agent_setup_mixin.py fix(cli): persist YOLO mode across --resume 2026-08-02 20:30:06 -07:00
cli_billing_mixin.py
cli_commands_mixin.py fix(cli): persist YOLO mode across --resume 2026-08-02 20:30:06 -07:00
cli_output.py
clipboard.py
codex_models.py
codex_runtime_plugin_migration.py
codex_runtime_switch.py
colors.py
commands.py
completion.py
config.py
config_defaults.py fix(gateway): defer in-band restart until active turns finish (#77184) 2026-08-03 09:57:58 +05:30
config_migrations.py
console_engine.py
container_boot.py
context_switch_guard.py
copilot_auth.py
credential_lifecycle.py
cron.py
curator.py
curses_ui.py
dashboard_procs.py
dashboard_register.py
debug.py
default_soul.py
dep_ensure.py
diagnostics_upload.py
dingtalk_auth.py
doctor.py
dump.py feat(gateway): session activity watchdog, stall notify, compress timeout (#72424) 2026-08-02 16:16:36 -07:00
env_loader.py fix(env): make config.yaml authoritative for terminal.backend (#29186) 2026-08-02 18:21:58 -07:00
fallback_cmd.py
fallback_config.py
focus_view.py
gateway.py fix(gateway): defer in-band restart until active turns finish (#77184) 2026-08-03 09:57:58 +05:30
gateway_enroll.py
gateway_windows.py
goals.py
gui_uninstall.py
hooks.py feat(hooks): outbound webhooks — push signed lifecycle events to external HTTP endpoints 2026-08-02 15:01:11 -07:00
init_command.py
input_sanitize.py
inventory.py
journey.py
kanban.py
kanban_db.py
kanban_decompose.py
kanban_diagnostics.py
kanban_specify.py
kanban_swarm.py
lifecycle.py
logs.py
main.py chore: round-2 review nits (re-review #9) 2026-08-02 16:16:36 -07:00
managed_scope.py
managed_uv.py
mcp_catalog.py
mcp_config.py
mcp_picker.py
mcp_security.py
mcp_startup.py
mem_trim.py fix(mem): 5s force floor so delegate-batch closes don't stack trims 2026-08-02 22:44:38 +05:30
memory_oauth.py
memory_setup.py
middleware.py
migrate.py
moa_cmd.py
moa_config.py
model_catalog.py
model_cost_guard.py
model_normalize.py
model_search.py
model_setup_flows.py
model_switch.py perf(cli): cap /model picker custom-endpoint probe at 1.5s 2026-08-02 22:16:52 +05:30
models.py perf(models): cache GitHub Copilot model catalog for 5 minutes 2026-08-03 13:47:03 +05:30
nous_account.py
nous_auth_keepalive.py
nous_billing.py
nous_subscription.py
npm_engine.py
onepassword_secrets_cli.py
oneshot.py
pairing.py
partial_compress.py
pets.py
platforms.py
plugins.py
plugins_cmd.py
portal_cli.py
profile_describer.py
profile_distribution.py
profiles.py
projects_cmd.py
projects_db.py
prompt_size.py
prompt_stash.py
provider_catalog.py
providers.py
proxy_cli.py
psutil_android.py
pt_input_extras.py
pty_bridge.py
pty_session.py
relaunch.py
route_identity.py
runtime_provider.py
secret_prompt.py
secrets_cli.py
security_advisories.py
security_audit.py
security_audit_startup.py
send_cmd.py feat(gateway): simplex channel enumeration + show configured platforms in hermes send --list 2026-08-02 15:08:45 -07:00
service_manager.py
session_export.py
session_export_html.py
session_export_md.py
session_filters.py
session_listing.py
session_recap.py
session_recovery.py
sessions_cmd.py
setup.py
setup_hidden_env.py
setup_whatsapp_cloud.py
skills_config.py
skills_hub.py
skin_cmd.py
skin_engine.py
slack_cli.py
slash_exec.py
sqlite_runtime.py
sqlite_safe_read.py
sqlite_util.py
status.py chore: round-2 review nits (re-review #9) 2026-08-02 16:16:36 -07:00
stdio.py
suggestions_cmd.py
telegram_managed_bot.py
timefmt.py chore: round-2 review nits (re-review #9) 2026-08-02 16:16:36 -07:00
timeouts.py
tips.py fix(gateway): defer in-band restart until active turns finish (#77184) 2026-08-03 09:57:58 +05:30
tools_config.py fix(a2a): default the a2a toolset OFF (opt-in), like spotify 2026-08-02 15:10:15 -07:00
toolset_validation.py
uninstall.py
update_cmd.py fix(gateway): defer in-band restart until active turns finish (#77184) 2026-08-03 09:57:58 +05:30
update_lock.py
urllib_security.py
vercel_auth.py
voice.py
web_deps.py
web_git.py
web_models.py
web_server.py fix(desktop): keep cold gateway config off event loop 2026-08-02 23:20:24 +05:30
webhook.py
win_pty_bridge.py
windows_ssh_runtime.py
write_approval_commands.py
xai_retirement.py