Skip to content

fix: P1/P2 bugs — session DB, tool calls, Telegram proxy, cron, oneshot skills - #1

Closed
dizhaky wants to merge 2 commits into
mainfrom
cursor/fix-p1-open-issues-c26f
Closed

fix: P1/P2 bugs — session DB, tool calls, Telegram proxy, cron, oneshot skills#1
dizhaky wants to merge 2 commits into
mainfrom
cursor/fix-p1-open-issues-c26f

Conversation

@dizhaky

@dizhaky dizhaky commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

Two-commit batch addressing well-scoped upstream bugs. Does not close the full open-issue backlog on NousResearch/hermes-agent.

Fixes (commit 1)

Issue Fix
NousResearch#31507 Clamp _last_flushed_db_idx after scaffolding drop
NousResearch#31583 content: null for pure tool-call assistant turns
NousResearch#31599 Bound httpx pool when Telegram uses HTTP proxy

Fixes (commit 2)

Issue Fix
NousResearch#31570 Cron scanner: re.sub all GitHub skill auth-header curls (not just first)
NousResearch#31560 MEDIA: extractor recognizes .md / .html / .htm (case-insensitive)
NousResearch#31556 Credential pool uses load_config_readonly() (avoids repeated deepcopy on /model picker)
NousResearch#31555 Skip Ollama /api/show probe for known cloud providers
NousResearch#31548 hermes -z --skills preloads skills via ephemeral_system_prompt

Tests

  • tests/run_agent/test_empty_response_recovery_persistence.py
  • tests/run_agent/test_run_agent.py (tool-call content)
  • tests/tools/test_cronjob_tools.py
  • tests/gateway/test_platform_base.py
  • tests/agent/test_model_metadata.py
  • tests/hermes_cli/test_tui_resume_flow.py

Not in scope

Slack Thread

Open in Web Open in Cursor 

cursoragent and others added 2 commits May 24, 2026 19:23
…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>
@cursor cursor Bot changed the title fix: P1/P2 session DB flush, tool-call content, Telegram proxy pool fix: P1/P2 bugs — session DB, tool calls, Telegram proxy, cron, oneshot skills May 24, 2026
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 dizhaky closed this May 25, 2026
@dizhaky
dizhaky deleted the cursor/fix-p1-open-issues-c26f branch May 25, 2026 21:52
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants