Skip to content

feat(gateway): show live agent activity in /status (current tool, iteration, idle) - #83167

Open
Visol-456 wants to merge 2 commits into
NousResearch:mainfrom
Visol-456:feat/status-live-activity
Open

feat(gateway): show live agent activity in /status (current tool, iteration, idle)#83167
Visol-456 wants to merge 2 commits into
NousResearch:mainfrom
Visol-456:feat/status-live-activity

Conversation

@Visol-456

Copy link
Copy Markdown

PR Description — feat/status-live-activity

What does this PR do?

/status is the manual, on-demand view of a running agent, but while the agent is busy it reports only a bare boolean ("Agent running: yes/no") plus session metadata, model and token counts. When a turn drags on (e.g. a provider stalls on the SSE connection for minutes, then a slow auxiliary call like vision_analyze adds more wait), the user cannot tell whether the agent is waiting on the API, executing a tool, compressing context, or stalled — there is no basis to decide between waiting, interrupting, or investigating. The automatic "still working" heartbeat (agent.gateway_notify_interval, default 180s) already surfaces this live activity, but a manual /status query returns none of it.

This PR appends a live activity block to /status when the session's agent is running, built from the existing shared activity observation contract AIAgent.get_activity_summary() (run_agent.py, #72016/#72039) — the same single source the heartbeat and busy-ack already use. No new data collection, no core agent changes: the pushed view and the pulled view now show the same information.

Related Issue

Fixes #83077

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)

Changes Made

  • gateway/slash_commands.py — _handle_status_command(): when is_running and the agent exposes get_activity_summary(), append a Activity: line with iteration progress (iteration x/y), current tool (or last activity description), and idle seconds (>=5s threshold to avoid "idle 0s" noise). Guarded with hasattr + try/except so stub agents or activity-read failures never break /status (mirrors the heartbeat's observation-only pattern).
  • locales/*.yaml (18 files) — added 4 keys (gateway.status.activity/iteration/running/idle) to every locale to satisfy catalog parity (tests/agent/test_i18n.py), with zh/zh-hant and other languages translated, not just English placeholders.
  • tests/gateway/test_status_command.py — 3 new tests: running agent renders the activity block; stub agent without get_activity_summary doesn't crash and renders no activity line; no running agent renders no activity line.

How to Test

  1. python -m pytest tests/agent/test_i18n.py tests/gateway/test_status_command.py -q — all pass (one pre-existing platform-specific failure on Windows only: test_profile_command_reports_source_stamped_profile, unrelated to this change — pytest tmp dir under C:\Users<user> triggers display_hermes_home()'s ~/ abbreviation; CI on Linux is green).
  2. Start a long turn (e.g. ask for a slow task), then send /status — output now shows e.g. Activity: iteration 3/20 · running: web_fetch · idle 12s.
  3. Verify /status between turns shows no activity line (unchanged behavior).

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (feat(scope):, fix(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass — ran the targeted files (test_i18n.py, test_status_command.py); full suite not run on Windows
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Windows 10

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

tests/agent/test_i18n.py + tests/gateway/test_status_command.py: 47 passed, 1 failed
(1 failure = pre-existing Windows-only /profile home-path abbreviation test, untouched by this PR)

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists labels Aug 10, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #43993: both add the shared running-agent activity summary (iteration, activity/tool, idle time) to /status.

@Visol-456
Visol-456 force-pushed the feat/status-live-activity branch from 5510b8c to f461ac3 Compare August 10, 2026 11:34
@Visol-456

Copy link
Copy Markdown
Author

Thanks for the triage. I understand the overlap with #43993 (LifeJiggy) — both PRs surface the running-agent activity
summary in /status. Since the label suggests one of them should go, here are the concrete differences so a human maintainer can decide: #43993 has been open since June 11 with no review, has drifted into a merge conflict, and its CI has not been re-run since; my PR is currently mergeable with green checks. On implementation: #43993 folds the detail into the agent_running line as "Yes (iter x/y, idle Ns, desc)" and adds a pending state; mine renders a separate Activity: line showing the current tool name (via current_tool, falling back to last_activity_desc), iteration count vs max, and idle seconds with a 5s threshold so a fresh activity doesn't render "idle 0s" noise, plus a float() guard matching the heartbeat's own parsing. On i18n: both PRs add new keys to all locale files, but #43993 fills every language with the English strings ("Starting up ⏳", "Yes ⚡ ({detail})" in zh.yaml too), while mine ships actual translations — zh "运行中/空闲/迭代", zh-hant "執行中/閒置/迭代", ja "アイドル", de "inaktiv" — so non-English users get the feature in their own language instead of a silent English fallback. On docs: #43993 does not touch the documentation, while mine updates the /status description in website/docs/reference/slash-commands.md to match the new behavior. Happy to rebase either way — if the maintainers prefer #43993's structure (especially its pending-agent state, which mine doesn't cover), I can port the extra bits onto it and close mine; otherwise I'd appreciate this one being considered on its own merits since it's currently the mergeable, conflict-free implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: /status has no live activity for the running agent — manual query should match the 3-min heartbeat (current tool, iteration, idle time)

2 participants