Skip to content

feat(cli): add /plan slash command to view agent's todo list#36931

Open
TumCucTom wants to merge 4 commits into
NousResearch:mainfrom
TumCucTom:feat/plan-slash-command
Open

feat(cli): add /plan slash command to view agent's todo list#36931
TumCucTom wants to merge 4 commits into
NousResearch:mainfrom
TumCucTom:feat/plan-slash-command

Conversation

@TumCucTom

Copy link
Copy Markdown
Contributor

Summary

Implements the /plan slash command requested in #36821. The command renders the agent's in-process TodoStore as a boxed table with status markers, so users can check task progress without waiting for the agent to respond. No LLM round-trip.

Subcommands

  • /plan — show all items (pending / in_progress / completed / cancelled)
  • /plan pending — only pending + in_progress
  • /plan clear — wipe the list (with confirmation; --yes / now skip)

Example

  📋 Current Plan
  ┌──────────────────────────────────────────────┐
  │ Current Plan                                 │
  ├──────────────────────────────────────────────┤
  │  1. ✓ Set up project structure               │
  │  2. ✓ Implement auth module                  │
  │  3. ● Write integration tests  (in_progress) │
  │  4. ○ Deploy to staging                      │
  │  5. ○ Update documentation                   │
  │  6. ✗ Abandoned idea                         │
  └──────────────────────────────────────────────┘
  Progress: 2/5 completed
  (1 cancelled item hidden from progress count)

Implementation

  • Registered CommandDef("plan", "Show the agent's current todo list", "Session", cli_only=True, args_hint="[pending|clear]") in hermes_cli/commands.py.
  • Added HermesCLI._handle_plan_command in cli.py that reads self.agent._todo_store (initialized in agent/agent_init.py:1042) and renders a Unicode-bordered table.
  • Wired the dispatch in HermesCLI.process_command.
  • /plan clear reuses the existing destructive-slash confirmation gate (_confirm_destructive_slash) and inline --yes / now skip tokens, matching the /new and /reset patterns.

Why CLI-only

The issue labels include comp/cli, comp/tui and the body describes "in the TUI". The agent's TodoStore is per-AIAgent, and surfacing it through the gateway would require sourcing the right agent for the session key plus i18n translations. Keeping it CLI-only matches the issue's "first PR" framing and the scope of existing CLI-only commands like /history and /save. Gateway support can be added as a follow-up if there's demand.

Test plan

  • New tests/cli/test_cli_plan_command.py (19 tests) covers:
    • Registry entry + metadata
    • process_command dispatch + no collision with /status or /history
    • Empty store, no agent, unknown subcommand, default render
    • pending filter behaviour
    • clear with approval, cancellation, empty store, no agent
    • --yes and now skip tokens bypass the gate
    • Box-drawing borders align
  • Manually exercised against MagicMock-backed HermesCLI instances and a real TodoStore.

Platforms

  • Tested on macOS aarch64, Python 3.11.15, hermes venv.
  • check-windows-footguns.py reports no issues.
  • ruff check clean.

Out of scope

  • Ctrl+P keybinding (mentioned as optional in the issue, easy follow-up).
  • Gateway (/plan from Telegram/Discord/Slack) — see "Why CLI-only" above.

Fixes #36821.

🤖 Generated with Claude Code

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Jun 1, 2026
@TumCucTom

Copy link
Copy Markdown
Contributor Author

Pushed a follow-up commit that adds both my contributor emails to `scripts/release.py` AUTHOR_MAP:

```
"hf23482@bristol.ac.uk": "TumCucTom", # PR #36931 (/plan slash command)
"tokbale@outlook.com": "TumCucTom", # earlier commits by the same contributor
```

This unblocks the new `Contributor Attribution Check` workflow. Locally I verified the check passes against the new commit:

```
$ git log origin/main..HEAD --format='%ae' --no-merges | sort -u
hf23482@bristol.ac.uk
$ grep -F '"hf23482@bristol.ac.uk"' scripts/release.py
"hf23482@bristol.ac.uk": "TumCucTom", # PR #36931 (/plan slash command)
```

@maintainers — would you mind re-running the `check-attribution` job to confirm?

TumCucTom and others added 2 commits June 1, 2026 23:01
Adds a new /plan slash command (cli-only) that renders the agent's
in-process TodoStore as a boxed table with status markers, so users
can check task progress without waiting for the agent to respond.

Subcommands:
  /plan         show all items (pending/in_progress/completed/cancelled)
  /plan pending show only pending + in_progress
  /plan clear   wipe the list (with confirmation, --yes/now to skip)

Reads self.agent._todo_store (initialized in agent/agent_init.py)
directly -- no LLM round-trip. /plan clear respects the existing
destructive-slash confirmation gate and the inline --yes/-y/now
skip tokens used by /new and /reset.

Fixes NousResearch#36821.

Co-authored-by: Zippy AI <tomkinsbale@icloud.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The new contributor-check CI workflow requires every new committer
email to be mapped to a GitHub username in scripts/release.py.
Adds both known emails for the same contributor.

Co-authored-by: Zippy AI <tomkinsbale@icloud.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@TumCucTom TumCucTom force-pushed the feat/plan-slash-command branch from 31ad6c8 to 17f7e14 Compare June 1, 2026 22:02
TumCucTom and others added 2 commits June 1, 2026 23:30
The test times out under xdist load (drain thread stuck in select.select)
on a 30s pytest-timeout. Not related to /plan changes. Re-poke CI to get
a fresh runner slot.

Co-authored-by: Zippy AI <tomkinsbale@icloud.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard 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: Add /plan slash command to view current todo list

2 participants