Conversation
2e1e58c to
bf91f35
Compare
1c984e4 to
33360eb
Compare
|
I like this shape: opt-in, uses the existing mirror path, and stores the delivered message instead of pretending the cron agent's scratch context belongs in the live chat. The detail I would watch is the "same thing the user saw" invariant. If the wrapper says the agent cannot see the message while append_to_session is on, or if the mirrored content differs from the delivered content, users still end up debugging memory rather than using the feature. It looks like this PR already updates the wrapper language, which is important. A small acceptance test worth keeping around: enable append_to_session for a cron that delivers into a gateway chat, deliver a report, then send a normal follow-up in that chat and verify session context includes the delivered report with the job id/output pointer, not the whole cron transcript. |
|
Strong +1 for this. This solves a real Telegram/forum-topic UX problem: scheduled cron outputs are delivered into a topic, then the user replies naturally (“this one”, “the last cron”, “buy it”, “why did you pick that?”), but the live agent has no context because the cron delivery is isolated. The important constraints for me:
I would use this immediately for shopping/watch crons and content-publishing crons where follow-up conversation is expected. |
|
Thanks for the opt-in design and for identifying the follow-up-context UX. Problems
Suggested changes
Automated hermes-sweeper review. |
|
Big support here thought my agent was mad until i realised it doesn't have the same context I do. |
What does this PR do?
Adds an opt-in way for cron deliveries to become part of the target chat's session context.
Cron jobs can now set
append_to_sessionper job, or inherit a new global defaultcron.append_deliveries_to_session. After a successful delivery, the scheduler mirrors the raw delivered content into the matching target session so follow-up replies in that same chat or topic can refer to the cron message naturally.Wrapped cron deliveries now reflect the effective behavior. When session mirroring is enabled, the wrapper explicitly says follow-up replies in that chat can refer to the message instead of implying the agent cannot see it.
The implementation reuses the existing
gateway.mirror.mirror_to_session()path instead of inventing a cron-specific context cache. Session freshness updates and sessions-index persistence now live ingateway.session, so mirrored cron deliveries also refresh the matched session'supdated_atwithout leaving low-levelsessions.jsonwrites insidegateway.mirror.Related Issue
N/A
Related upstream context:
Type of Change
Changes Made
append_to_sessionto cron job creation/update/listing, job storage, and the API server cron endpoints.cron.append_deliveries_to_session, document it incli-config.yaml.example, and bump the config schema version.true; per-job overrides global, raw content is mirrored instead of the cron wrapper, and the matched sessionupdated_atis refreshed throughgateway.session.How to Test
append_to_session=true, let it fire, then reply in that same chat with a follow-up likeadd that to my calendar.cron.append_deliveries_to_session: truein~/.hermes/config.yaml, verify jobs inherit the behavior by default, then setappend_to_session=falseon a noisy job and confirm it no longer appends into session context.cron.wrap_response: true, verify that mirrored deliveries sayFollow-up replies in this chat can refer to this message.rather than implying the delivered content is detached from session context.source .venv/bin/activate python -m pytest tests/gateway/test_mirror.py tests/gateway/test_session.py tests/cron/test_scheduler.py tests/cron/test_jobs.py tests/tools/test_cronjob_tools.py tests/gateway/test_api_server_jobs.py tests/hermes_cli/test_cron.py tests/cli/test_cli_init.py -qChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Targeted test result:
python -m pytest tests/gateway/test_mirror.py tests/gateway/test_session.py tests/cron/test_scheduler.py tests/cron/test_jobs.py tests/tools/test_cronjob_tools.py tests/gateway/test_api_server_jobs.py tests/hermes_cli/test_cron.py tests/cli/test_cli_init.py -q→294 passed, 37 warnings