hermes-bsd/agent
NiuNiu Xia fb07215844 fix(copilot): recognize enterprise subdomains in host checks
The earlier enterprise base URL change (proxy-ep parsing) gave us URLs
like `api.enterprise.githubcopilot.com`, but ~15 host-matching call
sites still hard-coded `api.githubcopilot.com`. Enterprise users would
therefore drop the `Copilot-Integration-Id: vscode-chat` header at
client-build time, and upstream rejected requests with:

    The requested model is not available for integrator "zed"
    (or "copilot-language-server") — verify the correct
    Copilot-Integration-Id header is being sent.

The header was correct in copilot_default_headers(); it just never
made it into default_headers for non-default hostnames because every
detector compared against the exact string "api.githubcopilot.com".

This commit broadens all those checks to "githubcopilot.com" via
base_url_host_matches (which already does proper subdomain matching),
so api.enterprise.githubcopilot.com, api.business.githubcopilot.com,
etc. all share the same headers, vision routing, max_completion_tokens
selection, and reasoning-effort detection as the default endpoint.

Also adds ".githubcopilot.com" to _URL_TO_PROVIDER so context-window
resolution via models.dev works for enterprise base URLs, and tightens
_is_github_copilot_url to use suffix matching instead of strict equality.

Tests:
- New: enterprise Copilot endpoint preserves Copilot-Integration-Id
- New: enterprise endpoint returns max_completion_tokens (not max_tokens)
- Existing 333 base_url / copilot / aux-client / credential-pool tests pass

Parts 5 of #7731.
2026-06-30 03:27:41 -07:00
..
lsp
pet feat(pets): quality-first OpenRouter model chain + stronger atlas gates + global pet-gen notifications 2026-06-24 23:11:21 -05:00
secret_sources
transports fix(agent): guard against non-dict model_extra in tool call normalization 2026-06-30 03:27:12 -07:00
__init__.py
account_usage.py
agent_init.py fix(copilot): recognize enterprise subdomains in host checks 2026-06-30 03:27:41 -07:00
agent_runtime_helpers.py fix(agent): flatten multi-part user_message in codex intermediate-ack detector 2026-06-30 03:20:11 -07:00
anthropic_adapter.py fix(anthropic): stop SDK auto-retry double-firing and raise Retry-After cap to 600s 2026-06-27 19:23:15 -07:00
async_utils.py
auxiliary_client.py fix(copilot): recognize enterprise subdomains in host checks 2026-06-30 03:27:41 -07:00
azure_identity_adapter.py
background_review.py feat(background-review): aux-model selector for the self-improvement review (#49252) 2026-06-22 14:54:53 -07:00
bedrock_adapter.py
billing_view.py
browser_provider.py
browser_registry.py
chat_completion_helpers.py fix(copilot): recognize enterprise subdomains in host checks 2026-06-30 03:27:41 -07:00
codex_responses_adapter.py
codex_runtime.py
coding_context.py feat(agent): add configurable coding_instructions 2026-06-30 00:59:59 -05:00
context_breakdown.py feat(desktop): add context usage breakdown popover 2026-06-29 09:18:10 -04:00
context_compressor.py fix(agent): make compression lock-lease refresher tolerate transient DB blips 2026-06-30 13:36:29 +05:30
context_engine.py
context_references.py perf(context-refs): expand @-references concurrently 2026-06-30 00:19:49 -07:00
conversation_compression.py fix(agent): make compression lock-lease refresher tolerate transient DB blips 2026-06-30 13:36:29 +05:30
conversation_loop.py fix(agent): stop over-cap max_tokens 400s from death-looping into compression (#55570) 2026-06-30 03:26:41 -07:00
copilot_acp_client.py fix(agent): stream copilot ACP chat completions 2026-06-28 22:52:51 -07:00
credential_persistence.py
credential_pool.py fix(copilot): switch to VS Code client ID and derive enterprise base URL 2026-06-30 03:27:41 -07:00
credential_sources.py
credits_tracker.py
curator.py fix(curator): never archive cron-referenced skills + floor use=0 pruning (#54443) 2026-06-28 15:10:21 -07:00
curator_backup.py
display.py feat(display): friendly human-phrased tool labels for built-in tools (#55166) 2026-06-29 20:31:17 -07:00
error_classifier.py fix(agent): add MiniMax 'new_sensitive' to content_policy_blocked patterns 2026-06-28 01:15:21 -07:00
errors.py
file_safety.py fix: use os.pathsep, add tests, update tips for multi-root support 2026-06-27 04:01:12 +05:30
gemini_native_adapter.py
gemini_schema.py
i18n.py
image_gen_provider.py
image_gen_registry.py
image_routing.py fix(vision): detect Ollama vision models via /api/show (#54511) 2026-06-28 22:52:59 -07:00
insights.py
iteration_budget.py
jiter_preload.py
learn_prompt.py fix(learn): name distilled skills as author Hermes, not the host OS user (#52388) 2026-06-25 12:48:08 -07:00
learning_graph.py fix(desktop): scope memory graph cache by profile 2026-06-30 03:44:41 -05:00
lmstudio_reasoning.py
manual_compression_feedback.py
markdown_tables.py
memory_manager.py fix(agent): validate context/memory tool schemas before wrapping 2026-06-25 02:17:29 +05:30
memory_provider.py
message_content.py
message_sanitization.py fix(agent): close tool-call sequence on all interrupt aborts, not just finalize_turn 2026-06-25 12:24:34 -05:00
moa_loop.py fix(moa): preserve Nous provider identity for references 2026-06-28 00:47:15 -07:00
model_metadata.py fix(copilot): recognize enterprise subdomains in host checks 2026-06-30 03:27:41 -07:00
models_dev.py
moonshot_schema.py
nous_rate_guard.py
onboarding.py
oneshot.py feat(agent): one-shot LLM helper + llm.oneshot gateway RPC (#51261) 2026-06-23 08:01:50 +00:00
plugin_llm.py
portal_tags.py
process_bootstrap.py fix(auxiliary): use env-only proxy policy for OpenAI SDK clients (#53702) 2026-06-27 21:22:49 -07:00
prompt_builder.py fix(agent): limit .hermes.md parent walk to git repos only 2026-06-28 20:46:32 -07:00
prompt_caching.py
rate_limit_tracker.py
reasoning_timeouts.py fix(agent): detect thinking-timeout for reasoning models and surface actionable guidance instead of misleading file-write advice 2026-06-25 19:00:48 -07:00
redact.py fix(security): redact bare-token credentials in URL userinfo (#6396) (#54475) 2026-06-28 18:52:42 -07:00
replay_cleanup.py fix(tui): sanitize replay history on WebUI/TUI session resume (#29086) (#53939) 2026-06-27 20:56:49 -07:00
retry_utils.py fix: handle named custom providers and Z.AI overload retries 2026-06-25 00:17:17 -07:00
runtime_cwd.py
secret_scope.py
shell_hooks.py feat(agent): add pre_verify hook and verify-on-stop coding guidance 2026-06-30 00:59:29 -05:00
skill_bundles.py
skill_commands.py
skill_preprocessing.py fix(windows): hide console-window flash on backend git/gh/wmic/bash subprocess spawns 2026-06-28 05:28:45 -07:00
skill_utils.py fix(curator): protect external skills from background curation 2026-06-25 22:03:02 -07:00
ssl_guard.py
stream_diag.py
subdirectory_hints.py
system_prompt.py feat(computer_use): cross-platform cua-driver (macOS/Windows/Linux) 2026-06-22 06:42:30 -07:00
think_scrubber.py
thinking_timeout_guidance.py fix(agent): detect thinking-timeout for reasoning models and surface actionable guidance instead of misleading file-write advice 2026-06-25 19:00:48 -07:00
title_generator.py
tool_dispatch_helpers.py feat(agent): require verification before finishing edits 2026-06-24 23:02:48 -05:00
tool_executor.py feat(display): friendly human-phrased tool labels for built-in tools (#55166) 2026-06-29 20:31:17 -07:00
tool_guardrails.py
tool_result_classification.py
trajectory.py
transcription_provider.py
transcription_registry.py
tts_provider.py
tts_registry.py
turn_context.py fix(agent): persist compression backoff across resume (#54465) 2026-06-30 13:36:29 +05:30
turn_finalizer.py fix(agent,gateway): surface partial-stream recovery and bound detached restart 2026-06-27 22:03:14 -07:00
turn_retry_state.py fix(agent): route content-filter stream stalls to fallback chain (#32421) 2026-06-28 01:15:21 -07:00
usage_pricing.py
verification_evidence.py feat(agent): recognize focused ad-hoc verification scripts 2026-06-24 23:03:45 -05:00
verification_stop.py feat(agent): restore surface-aware "auto" default for verify_on_stop 2026-06-30 01:43:08 -05:00
verify_hooks.py feat(agent): add pre_verify hook and verify-on-stop coding guidance 2026-06-30 00:59:29 -05:00
video_gen_provider.py
video_gen_registry.py
web_search_provider.py
web_search_registry.py