Repository navigation
Conversation
179045a to
3694ec6
Compare
An accepted Discord follow-up during an in-flight turn was seeing only the pre-delivery snapshot, even after the same session had already persisted the opted-in briefing. Co-authored-by: Cursor <cursoragent@cursor.com>
3694ec6 to
2ff0beb
Compare
|
Rebased onto the latest |
|
Updated this PR on the current Successful opted-in cron delivery now records a session-scoped handoff. Accepted normal and priority active-turn redirects transfer that handoff to the running agent, and the redirect correction adds it as labeled reference context in Verification: There are no review threads to resolve on this PR. |
What does this PR do?
An opted-in cron briefing can already be delivered to Discord and persisted in the exact reply-facing session, but an accepted active-turn redirect still built model-facing messages from the pre-delivery in-memory snapshot. A bare follow-up then reached the agent without the brief.
This PR records a session_id-scoped delivery handoff at the moment a successful
attach_to_session: truepersist lands. An accepted normal or priority busy redirect moves that handoff onto the running agent._apply_active_turn_redirectthen includes it as a labeled reference block inapi_content(not as a new user instruction). The cached prefix, live tool state, and role alternation stay unchanged.Related Issue
Fixes #107856
Type of Change
Changes Made
gateway/cron_delivery_handoff.py— in-process pending handoff keyed by exact ; attach/drain/format helpers. Fail-open, never raises.cron/scheduler_delivery.py— after a successful opted-in mirror/seed persist, record the handoff. Delivery is never reported failed because bookkeeping broke.gateway/run_busy.py— / : after an accepted unquoted redirect, move same-session handoffs onto the agent. Do not rewrite / user content.agent/conversation_loop.py— consume agent-scoped references into only.tests/cron/test_discord_cron_followup_context.py— issue reproduction — idle attach controls plus DM/thread × normal/priority active redirects.How to Test
scripts/run_tests.shon the files in Changes Made — focused verificationHERMES_PYTHON=<venv-with-pytest+discord.py> scripts/run_tests.sh \tests/run_agent/test_steer.py,tests/cron/test_scheduler.py,tests/cron/test_mirror_origin_fallback.py,tests/gateway/test_busy_steer_origin.py,tests/gateway/test_mirror.py— 207 passed, 0 failed.scripts/run_tests.sh \Evidence
scripts/run_tests.shon the files in Changes Made — focused verification — 6 passedChecklist
Code
Documentation & Housekeeping
cli-config.yaml.example: N/ACONTRIBUTING.mdorAGENTS.md: N/A