Skip to content

fix: 5 bug fixes — cron type coercion, memory hooks, delegate logging, browser cleanup - #7424

Open
tyxben wants to merge 1 commit into
NousResearch:mainfrom
tyxben:fix/multi-bug-batch
Open

fix: 5 bug fixes — cron type coercion, memory hooks, delegate logging, browser cleanup#7424
tyxben wants to merge 1 commit into
NousResearch:mainfrom
tyxben:fix/multi-bug-batch

Conversation

@tyxben

@tyxben tyxben commented Apr 10, 2026

Copy link
Copy Markdown

Summary

Batch of 5 targeted fixes across agent core, cron, delegate, and browser modules:

  1. fix(cron): coerce repeat param from string to int ([TESTED FIX] TypeError when repeat='once' passed to cronjob create (string-to-int coercion missing) #7142) — LLMs generate repeat="once" which caused TypeError: "<=" not supported between instances of "str" and "int". Added try/except coercion in both cron/jobs.py and tools/cronjob_tools.py.

  2. fix(delegate): log on_delegation exceptions ([Bug]: on_delegation notification in delegate_tool.py silently swallows all exceptions #7194) — Bare except: pass silently swallowed all errors. Now logs at DEBUG level, consistent with memory_manager.py's existing pattern.

  3. fix(agent): call MemoryProvider.on_turn_start() in conversation loop ([Bug]: MemoryProvider.on_turn_start() hook is never called — breaks Honcho cadence logic and plugin turn tracking #7193) — Hook was defined in ABC and dispatched in memory_manager.py but never invoked from run_agent.py. Broke Honcho dialectic_cadence/injection_frequency and Supermemory turn tracking. Added call after _user_turn_count increment.

  4. fix(agent): capture on_pre_compress() return value and pass to compressor ([Bug]: MemoryProvider.on_pre_compress() return value silently discarded — provider insights never reach the compressor #7192) — Memory provider insights were silently discarded. Now threaded through compress()_generate_summary() as a "MEMORY PROVIDER INSIGHTS" section in the summarization prompt.

  5. cleanup(browser): remove dead browser_close schema and DEFAULT_SESSION_TIMEOUT (cleanup: remove dead browser_close schema and unused DEFAULT_SESSION_TIMEOUT #7173)browser_close was defined in BROWSER_TOOL_SCHEMAS but never registered (no handler). DEFAULT_SESSION_TIMEOUT was never referenced. Saves ~150 tokens per API call.

Test plan

  • All 316 tests in directly affected modules pass (context_compressor, cronjob, delegate, browser, cron)
  • Full test suite: 6906 passed (10 pre-existing failures in transcription/modal — unrelated optional deps)
  • browser_close and DEFAULT_SESSION_TIMEOUT have zero references after removal (verified via grep)
  • Manual: create cronjob with repeat="once" — should no longer TypeError
  • Manual: enable Honcho with dialectic_cadence > 1 and verify on_turn_start fires
  • Manual: trigger compression with a memory provider and verify insights appear in summary

1. fix(cron): coerce repeat param from string to int before comparison (NousResearch#7142)
   LLMs generate repeat="once" which caused TypeError on <= comparison.

2. fix(delegate): log on_delegation exceptions instead of silently swallowing (NousResearch#7194)
   Consistent with memory_manager.py's existing error handling pattern.

3. fix(agent): call MemoryProvider.on_turn_start() hook in conversation loop (NousResearch#7193)
   Hook was defined in ABC and dispatched in memory_manager but never
   invoked — broke Honcho cadence logic and plugin turn tracking.

4. fix(agent): capture on_pre_compress() return value and pass to compressor (NousResearch#7192)
   Memory provider insights were silently discarded. Now threaded through
   compress() → _generate_summary() into the summarization prompt.

5. cleanup(browser): remove dead browser_close schema and unused DEFAULT_SESSION_TIMEOUT (NousResearch#7173)
   Schema was defined but never registered; constant was never referenced.
@tyxben
tyxben force-pushed the fix/multi-bug-batch branch from c3c8270 to 5d36acd Compare April 12, 2026 08:49
@tyxben

tyxben commented Apr 12, 2026

Copy link
Copy Markdown
Author

Hi — the 4 CI workflows (Tests, Supply Chain Audit, Nix, Docker Build) are awaiting approval since this is a fork PR. Could a maintainer approve and run them when you get a chance? Thanks!

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cron Cron scheduler and job management tool/browser Browser automation (CDP, Playwright) tool/delegate Subagent delegation tool/memory Memory tool and memory providers labels Apr 29, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused fixes. Several underlying issues remain on current main, but this needs a targeted salvage rather than applying the current conflicting patch.

Problems

  • The proposed int(repeat) conversion does not handle the reported "once" value: it becomes None, which means an unbounded repeat for recurring schedules. Current display semantics identify one run as "once" in tools/cronjob_tools.py:348-355.
  • The agent files moved. Current compression invokes and discards the provider result at agent/conversation_compression.py:631-639; the default compressor now lives in agent/context_compressor.py (_generate_summary at line 1747, compress at line 2793), while the extension contract remains agent/context_engine.py:87-106.
  • No regression tests accompany the remaining cron, compression, or delegation changes.

Suggested changes

  • Reimplement the remaining fixes against the current paths, with create/update tests for numeric strings and explicit "once" behavior.
  • Thread pre-compression output through the current compressor while preserving custom context-engine compatibility, and test that it reaches the summary prompt.
  • Drop the now-redundant turn-start and browser-cleanup portions: current main calls on_turn_start at agent/turn_context.py:536-540, and browser cleanup was removed in 8b861b77c1f854a2b7914be1afa52facebfb046f.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit labels Jul 12, 2026
@teknium1 teknium1 added the area/memory Memory subsystem: store, providers, sync, background reviews label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state tool/browser Browser automation (CDP, Playwright) tool/delegate Subagent delegation tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants