Skip to content

fix: harden Discord sync and cron memory opt-in - #30965

Open
quantum-chaos wants to merge 3 commits into
NousResearch:mainfrom
quantum-chaos:fix/orion-cron-api-discord-pr
Open

fix: harden Discord sync and cron memory opt-in#30965
quantum-chaos wants to merge 3 commits into
NousResearch:mainfrom
quantum-chaos:fix/orion-cron-api-discord-pr

Conversation

@quantum-chaos

Copy link
Copy Markdown

Summary

  • delete stale Discord slash commands before creating/updating desired commands to avoid command-cap failures
  • allow cron jobs to explicitly opt into memory tools with allow_memory_tools
  • preserve safe uploaded image filename metadata in API-server multimodal normalization for SKU-aware workflows

Test Plan

  • uv run --with pytest python -m pytest tests/tools/test_cronjob_tools.py tests/cron/test_scheduler.py tests/gateway/test_api_server_normalize.py -q -o 'addopts='
  • Result: 201 passed in 3.24s

@daimon-nous daimon-nous Bot added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cron Cron scheduler and job management comp/plugins Plugin system and bundled plugins comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint platform/discord Discord bot adapter tool/memory Memory tool and memory providers labels May 23, 2026
@daimon-nous

daimon-nous Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

The Discord slash command sync fix (delete-before-create reorder) duplicates the approach in #24371, #29134, and #19366. The cron allow_memory_tools portion addresses #18885 and relates to #29301, #9802.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused regressions. The API filename and cron-tool access ideas still address behavior absent from current main, but the cron implementation needs rework; the Discord portion is already implemented.

Problems

  • The added skip_memory=False path initializes the external provider, then current turn finalization automatically calls sync_all and queue_prefetch_all (run_agent.py:3416-3424). Suppressing system-prompt memory does not prevent automatic persistence, so this does not provide the stated deliberate-tools-only behavior.
  • Discord deletion-before-create is already on main in plugins/platforms/discord/adapter.py:1897-1914, with the near-cap regression in tests/gateway/test_discord_sync_limit.py:61-140 (commit e9b86f352fc73db5ca3de6e3fb50ef57d774f8f9).

Suggested changes

  • Re-scope the cron work to a tools-only provider mode that blocks automatic prefetch/sync, and add an integration test using a provider that records lifecycle calls. agent/memory_provider.py:74-76 specifically identifies cron as a context providers should skip for writes.
  • Drop the superseded Discord hunk when salvaging.

This is an automated hermes-sweeper review.

Comment thread cron/scheduler.py
# autonomous/system prompts can corrupt user representations if
# ingested as ordinary context. Selected jobs can still opt into
# memory/Honcho tool initialization via allow_memory_tools=True;
# suppress_memory_prompt keeps injection off while preserving an

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting skip_memory=False enables the full external-provider lifecycle, not only its tools. Current turn finalization unconditionally calls sync_all and queue_prefetch_all for an initialized manager (run_agent.py:3416-3424), so this path automatically persists cron turns despite the tools-only claim. Please separate provider-tool exposure from prefetch/sync lifecycle activation and cover that with an integration test.

@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-moderate Sweeper blast radius: moderate — a subsystem or single platform area/memory Memory subsystem: store, providers, sync, background reviews labels Jul 13, 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 comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists platform/discord Discord bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform 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/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.

2 participants