fix: P1/P2 bugs — session DB, tool calls, Telegram proxy, cron, oneshot skills - #1
Closed
dizhaky wants to merge 2 commits into
Closed
fix: P1/P2 bugs — session DB, tool calls, Telegram proxy, cron, oneshot skills#1dizhaky wants to merge 2 commits into
dizhaky wants to merge 2 commits into
Conversation
…xy pool - Clamp _last_flushed_db_idx after scaffolding drop so state.db flush does not skip new assistant rows (NousResearch#31507). - Store null instead of empty string for pure tool-call assistant turns so strict OpenAI-compat shims accept replay (NousResearch#31583). - Bound httpx connection pool when Telegram uses an HTTP proxy (NousResearch#31599). Tests: test_empty_response_recovery_persistence, TestBuildAssistantMessage. Co-authored-by: dizhaky <dizhaky@users.noreply.github.com>
- Cron: scrub all bundled GitHub api.github.com auth-header curls (NousResearch#31570). - Gateway: extract MEDIA for .md/.html paths case-insensitively (NousResearch#31560). - Credential pool: use load_config_readonly() to avoid 69 deepcopies (NousResearch#31556). - Model metadata: skip Ollama /api/show probe for known cloud providers (NousResearch#31555). - Oneshot: wire --skills through to ephemeral_system_prompt (NousResearch#31548). Co-authored-by: dizhaky <dizhaky@users.noreply.github.com>
dizhaky
pushed a commit
that referenced
this pull request
May 25, 2026
…NousResearch#31416) PR NousResearch#31416 (avoid persisting borrowed credential secrets) added sanitize_borrowed_credential_payload, which strips access_token from any auth.json pool entry whose (provider, source) isn't in the _PERSISTABLE_PROVIDER_SOURCES allowlist. (copilot, gh_cli) is borrowed (not in the allowlist), so the test fixture's pre-seeded access_token now gets stripped at load_pool() time, leaving the pool empty. resolve_target('1') then fails with 'No credential #1. Provider: copilot.' Fix: align the test with the new contract. At runtime, copilot tokens are hydrated by resolve_copilot_token() — mock that path so the pool gets an entry the test can remove. The behavior under test (suppression of gh_cli + env variants on remove) is unchanged. CI repro on origin/main HEAD; reproduced locally with stock checkout.
dizhaky
added a commit
that referenced
this pull request
Jun 26, 2026
… — Codex PR #30 review (#31) Two chatgpt-codex-connector[bot] review comments on PR #30 that still applied to current main (the other 13 were already addressed in the merged PR): 1. client.py #13 — Cancel timed-out MCP calls: _run_sync now cancels the concurrent.futures.Future on timeout before re-raising, so a stalled MCP endpoint doesn't leave a pending HTTP session running on the shared background loop after the caller has given up / opened the breaker. 2. __init__.py #15 — Parse the host before allowing keyless local mode: is_available() now urlparse's the URL and requires an exact loopback host (localhost/127.0.0.1/::1) instead of a substring match, so a URL like 'https://localhost@example.com/mcp' (host=example.com) is no longer trusted as local keyless mode. Adds regression tests: test_memgw_client_timeout.py (cancel-on-timeout fails against pre-fix client) + TestKeylessLocalModeHostParsing (3/4 fail pre-fix). Deferred (already fixed in merged PR #30): MCP dep import check, MCP dep pin, loop lock, isError handling, stale-prefetch generation, sync/delegation thread tracking + shutdown join, session-switch prefetch invalidation, no join on turn path, default provider unset. Deferred (complex, needs interface change): #3/#4 per-turn user_id refresh for shared gateway sessions — sync_turn/prefetch only receive session_id, not user_id, so threading identity through requires a MemoryProvider interface change; #1 in-tree placement is an architectural call (AGENTS.md says existing in-tree providers stay).
dizhaky
pushed a commit
that referenced
this pull request
Jun 30, 2026
…ture get_copilot_api_token now returns (api_token, base_url); the auth-remove suppression test still mocked it as a bare string, mis-unpacking into the credential-pool seed path and failing with 'No credential #1'.
dizhaky
pushed a commit
that referenced
this pull request
Jun 30, 2026
…_id signature churn Two independent bugs evicted the cached gateway AIAgent on every turn, preventing the prompt cache from ever warming: 1. Model normalization mismatch: the post-run fallback-eviction check compared _agent.model (stripped in AIAgent.__init__) against the raw _resolve_gateway_model() config string. For vendor-prefixed config on native providers (e.g. 'deepseek/deepseek-v4-pro' vs 'deepseek-v4-pro') this was always unequal, so the agent was evicted after every successful run. Normalize _cfg_model the same way (skip aggregators). 2. Discord triggering message_id leaked into the cached system prompt via build_session_context_prompt()'s Discord IDs block. message_id changes every turn, so the agent-cache signature (computed from the ephemeral prompt) changed every Discord turn -> rebuild every message. The id is now injected per-turn into the user message (where per-turn content belongs and does not touch the cache signature); the cached IDs block carries a static pointer to it, preserving reply/react/pin via the discord tools. Adapted from NousResearch#28846. Bug #1 fix is the contributor's; bug #2 reworked to be non-destructive (keeps the triggering-id capability instead of deleting it). Redundant auto-reset eviction (already on main via NousResearch#9893/NousResearch#48031) and the wrong-premise reset_context_note plumbing from the original PR were dropped. Co-authored-by: Hermes Agent <hermes@nousresearch.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two-commit batch addressing well-scoped upstream bugs. Does not close the full open-issue backlog on NousResearch/hermes-agent.
Fixes (commit 1)
_last_flushed_db_idxafter scaffolding dropcontent: nullfor pure tool-call assistant turnsFixes (commit 2)
re.suball GitHub skill auth-header curls (not just first)MEDIA:extractor recognizes.md/.html/.htm(case-insensitive)load_config_readonly()(avoids repeated deepcopy on/modelpicker)/api/showprobe for known cloud providershermes -z --skillspreloads skills viaephemeral_system_promptTests
tests/run_agent/test_empty_response_recovery_persistence.pytests/run_agent/test_run_agent.py(tool-call content)tests/tools/test_cronjob_tools.pytests/gateway/test_platform_base.pytests/agent/test_model_metadata.pytests/hermes_cli/test_tui_resume_flow.pyNot in scope
display.busy_input_modeis configured)Slack Thread