Skip to content

fix(cli): hide cron sessions by default in sessions list and browse - #11537

Open
dso2ng wants to merge 1 commit into
NousResearch:mainfrom
dso2ng:fix/hide-cron-sessions-default-listings
Open

fix(cli): hide cron sessions by default in sessions list and browse#11537
dso2ng wants to merge 1 commit into
NousResearch:mainfrom
dso2ng:fix/hide-cron-sessions-default-listings

Conversation

@dso2ng

@dso2ng dso2ng commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • hide cron sessions by default in hermes sessions list
  • hide cron sessions by default in hermes sessions browse
  • preserve --source cron as an explicit opt-in for inspecting cron sessions
  • add regression coverage for both default filtering and explicit source behavior

Why

Frequent cron jobs create many background sessions that clutter the default interactive session views. This change keeps manual session navigation focused on user-facing sessions while preserving explicit access to cron sessions when requested.

Behavior before

  • hermes sessions list hid tool sessions by default, but still showed cron
  • hermes sessions browse hid tool sessions by default, but still showed cron

Behavior after

  • hermes sessions list hides both tool and cron by default
  • hermes sessions browse hides both tool and cron by default
  • hermes sessions list --source cron still shows cron sessions
  • hermes sessions browse --source cron still shows cron sessions

How to test

  • source venv/bin/activate && pytest tests/hermes_cli/test_session_browse.py -q
  • Start Hermes locally and compare:
    • hermes sessions list
    • hermes sessions list --source cron
    • hermes sessions browse
    • hermes sessions browse --source cron

Platforms tested

  • Linux (local Hermes development environment on omarchy)

Notes

  • This PR is intentionally scoped to the CLI session listing / browsing behavior only.

@dso2ng

dso2ng commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

Heads up: the workflow runs for this fork PR are currently showing action_required with 0s duration (for example Tests / Nix / Supply Chain Audit / Docker Build and Publish), which looks like they may still need maintainer approval before CI can actually start.\n\nOnce the workflows are approved/rerun, I can follow up on any real test failures if they appear.

@dso2ng
dso2ng force-pushed the fix/hide-cron-sessions-default-listings branch from eec8337 to 8e4551f Compare April 20, 2026 09:44
@dso2ng dso2ng changed the title fix: hide cron sessions by default in sessions list and browse fix(cli): hide cron sessions by default in sessions list and browse Apr 20, 2026
@dso2ng

dso2ng commented Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer note: this fork-based PR now has a clean single-commit history on top of current main, and the focused local regression suite is passing:

  • python -m pytest tests/hermes_cli/test_session_browse.py -q

Current blocker appears to be GitHub Actions approval for fork workflows: the PR checks are still showing action_required / zero-job runs, so CI has not actually started yet.

If a maintainer approves / runs the PR workflows in the GitHub UI, I can follow up on any real CI failures after that.

@dso2ng

dso2ng commented Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

@kshitijk4poor @teknium1 friendly ping on this one: the branch has been rebased/cleaned up into a single focused commit on top of current main, and the local regression test is passing.

The remaining blocker appears to be fork-workflow approval (action_required / 0s runs). If you approve/run the PR workflows in the GitHub UI, I can follow up on any real CI failures immediately after they execute.

@dso2ng
dso2ng force-pushed the fix/hide-cron-sessions-default-listings branch from 8e4551f to f9f29ed Compare April 21, 2026 08:34
@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 comp/cron Cron scheduler and job management labels Apr 24, 2026
@dso2ng
dso2ng force-pushed the fix/hide-cron-sessions-default-listings branch from f9f29ed to 37d771b Compare May 15, 2026 23:36
@dso2ng

dso2ng commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Refresh update: I force-pushed this branch as a clean single commit on top of current origin/main (31ba2b0cb).

Updated head: 37d771b23

The only refresh-specific change was aligning the new browse assertions with the current CLI default browse limit (500 instead of the older 50). The intended behavior is unchanged: sessions list / sessions browse still hide tool and cron sources by default, and explicit --source cron still bypasses the default exclusions.

Focused local verification on the refreshed branch:

  • python -m pytest tests/hermes_cli/test_session_browse.py -o 'addopts=' -q -> 37 passed
  • git diff --check

GitHub metadata now reports the PR as mergeable again. There are still no checks reported on this fork branch, so CI appears not to have run yet.

@dso2ng

dso2ng commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Refresh update: I merged current origin/main into this branch and resolved the hermes_cli/main.py conflict while preserving both invariants: upstream's third-party tool session filtering and this PR's default cron-session hiding.

Updated head: 33dff2365

Focused local verification on the refreshed head:

  • git diff --check -> passed
  • python -m py_compile hermes_cli/main.py tests/hermes_cli/test_session_browse.py -> passed
  • python -m pytest tests/hermes_cli/test_session_browse.py -o 'addopts=' -q -> 37 passed
  • public diff non-ASCII guard -> non_ascii_added_lines=0

GitHub now reports the PR as mergeable again. The new workflow runs are still at the fork workflow approval gate (action_required with zero jobs), not a code/test failure.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused CLI regression coverage. The premise remains valid on current main: hermes_cli/main.py:13825-13831 and hermes_cli/main.py:14405-14411 exclude only tool, while hermes_state.py:3075-3081 supports the proposed default exclusion plus explicit --source cron opt-in.

Problems

  • The added action = args.sessions_action is stale-context duplication: current main already initializes it at hermes_cli/main.py:13770. Keeping the PR line would add a second, unnecessary assignment.

Suggested changes

  • Omit that redundant assignment when salvaging; the exclusion changes and four behavior-contract tests are otherwise appropriately scoped to sessions list and sessions browse.

Automated hermes-sweeper review.

Comment thread hermes_cli/main.py Outdated
@@ -11290,9 +11290,12 @@ def cmd_sessions(args):
print(f"Error: Could not open session database: {e}")
return

# Hide third-party tool sessions by default, but honour explicit --source
action = args.sessions_action

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current main already assigns action = args.sessions_action at hermes_cli/main.py:13770; omit this duplicate assignment when salvaging the exclusion changes.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 12, 2026
Exclude cron sessions from the default session list and browse views while still honoring explicit --source cron queries.
@dso2ng
dso2ng force-pushed the fix/hide-cron-sessions-default-listings branch from 33dff23 to 863a2cf Compare July 13, 2026 02:17
@dso2ng

dso2ng commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks — addressed on the current head 863a2cf2d.

I removed the stale duplicate action = args.sessions_action assignment and kept the existing initialization from current main. The cron exclusion behavior and explicit --source cron opt-in remain covered by the focused session browse/list regression tests.

Focused verification on the updated head:

python -m pytest tests/hermes_cli/test_session_browse.py -o 'addopts=' -q
passed

Could you please re-review the updated head?

@teknium1 teknium1 added the area/sessions Session lifecycle, resume, persistence, history label Jul 19, 2026

@GottZ GottZ left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Summary

Four PRs are associated with this complex, but they cover two distinct causes: #11537 and #31499 reduce cron-session clutter, while #16370 and #54711 address raw arrow-key input in curses pickers. The current diffs show #11537 as the focused CLI list/browse fix and #54711 as the effective raw-sequence decoder integration.

Related pull requests

  • #11537 related — (+74/-5) — merge after CI: Adds cron to the default exclusions for both sessions list and sessions browse, preserves explicit --source cron, and tests all four behavior paths. The current diff addresses the keep_open review on #11537 by relying on the existing action initialization rather than adding the criticized duplicate assignment.
  • #16370 related — (+24/-0) — superseded by #54711: Although it targets the arrow-navigation symptom, the diff only enables keypad mode and does not decode raw ESC [ A/B sequences before the ESC-cancel branch. Despite the keep_open review on #16370, its documented required fix path and raw-input regression coverage are implemented by #54711 instead.
  • #31499 [closed] duplicate — (+5/-2) — closed duplicate of #11537: It remains relevant as evidence for the same cron-clutter policy, but modifies legacy CLI and gateway resume paths rather than #11537's current hermes sessions list and browse paths; the author closed it in favor of #11537.
  • #54711 related — (+197/-31) — merge separately: Routes the session browser and the sibling plugins picker through the existing raw-sequence decoder, with regression tests proving ESC [ A/B navigation and selection behavior. It satisfies the keep_open review on #54711 by extending the fix and tests to the contributor-identified sibling picker.

Duplicates

#31499 substantially duplicates the cron-session exclusion intent of #11537 and is already closed in its favor. #16370 and #54711 target the same arrow-navigation failure, but #54711 supersedes #16370 with the decoder-based implementation required by review.

Suggested consolidation

Merge #11537 after its fork CI is approved and passes, and retain #31499 as its closed duplicate. Merge #54711 as the separate raw-arrow fix and close #16370 as superseded, because keypad initialization alone does not handle the reported raw escape sequences whereas #54711 decodes them and covers both affected pickers.

Complex graph

flowchart LR
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    subgraph Dup11537 ["PRs duplicating each other"]
        P11537["PR #11537 (open)"]
        P31499["PR #31499 (closed)"]
    end
    class P11537 open
    class P31499 closed
    class P11537 target
    click P11537 "https://github.com/NousResearch/hermes-agent/pull/11537"
    click P31499 "https://github.com/NousResearch/hermes-agent/pull/31499"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).

Cross-PR triage: Reviewed 4 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 21 kB of PR diffs, 8 kB of issue/PR text, 9 kB of discussion (14 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

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

Labels

area/sessions Session lifecycle, resume, persistence, history comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants