Skip to content

feat(whatsapp): upsert busy messages via steer#17155

Open
EvolvingSoftwareAgent wants to merge 5 commits into
NousResearch:mainfrom
EvolvingSoftwareAgent:feat/whatsapp-upsert-steer
Open

feat(whatsapp): upsert busy messages via steer#17155
EvolvingSoftwareAgent wants to merge 5 commits into
NousResearch:mainfrom
EvolvingSoftwareAgent:feat/whatsapp-upsert-steer

Conversation

@EvolvingSoftwareAgent

@EvolvingSoftwareAgent EvolvingSoftwareAgent commented Apr 28, 2026

Copy link
Copy Markdown

Summary

Follow-up to #12116. This updates WhatsApp's busy-message path so messages sent while a WhatsApp-backed run is active can be steered into the running agent, while preserving the soft-session context introduced by #16953.

  • Builds on the WhatsApp /sessions soft-thread routing so busy follow-ups land in the correct Hermes session.
  • Installs a runner-owned WhatsApp busy-session handler for upsert_steer, reply_aware_steer, and explicit_steer policies.
  • Delivers accepted busy text through running_agent.steer(...) with quoted-reply context preserved.
  • Emits a visible /steer passed to LLM progress line at the actual delivery point.
  • Preserves explicit WhatsApp session/thread metadata for background completion notices and internal events.
  • Preserves bridge diagnostics and slash-command guidance across managed bridge reconnect/failure paths.
  • Adds regression coverage for WhatsApp upsert steer, soft sessions, media parsing/audio routing, internal event pairing, progress delivery, and bridge diagnostics.

Why

#12116 added the core mid-run /steer <prompt> primitive. WhatsApp needs the next layer: when a user replies or sends follow-up text while a session is busy, the gateway should be able to merge that context into the active run safely instead of treating it as a blunt interrupt or losing the reply/session association.

The runner owns the upsert handler rather than the adapter to avoid adapter-recursive dispatch. If a real running agent exists, the handler calls agent.steer(...); otherwise it returns False so the normal message insertion/queue path can proceed.

Current version

  • Refreshed onto current origin/main.
  • Current head: d8adf4620eefee6626e80aa828fca0a1cc5312f6.
  • Includes the current /sessions UX plus the WhatsApp bridge diagnostics/slash-guidance fix from the local version.

Test plan

  • git diff --check origin/main...HEAD
  • scripts/run_tests.sh tests/gateway/test_internal_event_bypass_pairing.py tests/gateway/test_platform_base.py tests/gateway/test_run_progress_topics.py tests/gateway/test_whatsapp_busy_steer.py tests/gateway/test_whatsapp_connect.py tests/gateway/test_whatsapp_sessions.py tests/gateway/test_whatsapp_group_gating.py tests/run_agent/test_steer.py -q — 246 passed, 1 warning

Full suite not run locally.

Related

Refresh status

  • Rebased/updated for merge-conflict-free merge against current main.
  • Current head: ae41ecefa.
  • Mergeability verified via GitHub API: mergeable: true; mergeable_state: unstable because GitHub checks are pending/absent, not because of conflicts.
  • Notes: Rebased upsert-steer WhatsApp slice onto current main, resolved conflicts in gateway/platforms/base.py, gateway/run.py, and run_agent.py, and preserved steer delivery progress callback after the runtime-helper refactor.
  • Test plan:
    • scripts/run_tests.sh tests/gateway/test_whatsapp_busy_steer.py tests/gateway/test_whatsapp_sessions.py tests/gateway/test_internal_event_bypass_pairing.py tests/gateway/test_platform_base.py tests/gateway/test_run_progress_topics.py tests/run_agent/test_steer.py tests/gateway/test_whatsapp_connect.py — 233 passed, 0 failed

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/agent Core agent loop, run_agent.py, prompt builder platform/whatsapp WhatsApp Business adapter labels Apr 28, 2026
@EvolvingSoftwareAgent EvolvingSoftwareAgent force-pushed the feat/whatsapp-upsert-steer branch from 8c416da to ee46abc Compare May 1, 2026 21:33
@EvolvingSoftwareAgent EvolvingSoftwareAgent force-pushed the feat/whatsapp-upsert-steer branch 2 times, most recently from 64a0ef4 to d8adf46 Compare May 17, 2026 01:30
@EvolvingSoftwareAgent EvolvingSoftwareAgent force-pushed the feat/whatsapp-upsert-steer branch from d8adf46 to ae41ece Compare May 27, 2026 09:09
@EvolvingSoftwareAgent EvolvingSoftwareAgent force-pushed the feat/whatsapp-upsert-steer branch from ae41ece to fa5b71c Compare June 2, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/whatsapp WhatsApp Business adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants