Skip to content

feat: Honcho session pruning CLI (#33436) - #33893

Open
ousiaresearch wants to merge 1 commit into
NousResearch:mainfrom
ousiaresearch:feat/honcho-prune
Open

feat: Honcho session pruning CLI (#33436)#33893
ousiaresearch wants to merge 1 commit into
NousResearch:mainfrom
ousiaresearch:feat/honcho-prune

Conversation

@ousiaresearch

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds hermes honcho prune command to prune stale Honcho sessions older than configured max age.

Fixes #33436

Type of Change

  • ✨ New feature

Changes Made

  • plugins/memory/honcho/cli.py: Added cmd_prune() with --dry-run, --force, --include-active flags + command routing + argparse registration
  • plugins/memory/honcho/client.py: Added prune_enabled and prune_max_age_days to HonchoClientConfig

How to Test

  1. hermes honcho prune --dry-run to preview
  2. hermes honcho prune --force to execute

Checklist

  • I have tested these changes locally

…33436)

Adds 'hermes honcho prune' CLI command with --dry-run, --force, and
--include-active flags. Classifies sessions by age vs configured
maxAgeDays (default 90), protects current session, and supports
interactive confirmation. Adds prune_enabled and prune_max_age_days
config fields to HonchoClientConfig.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins comp/cli CLI entry point, hermes_cli/, setup wizard tool/memory Memory tool and memory providers labels May 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Fixes #33436. Honcho prune feature also bundled in mega PR #33884.

@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 splitting the Honcho pruning work out of the closed mega PR #33884. Current main still has no hermes honcho prune command (plugins/memory/honcho/cli.py:1760-1864), so the feature remains independently useful.

Problems

  • plugins/memory/honcho/cli.py:294-299: --force is documented as confirmation bypass but also marks every undated session stale. hermes honcho prune --force can therefore delete sessions whose age was not established.
  • plugins/memory/honcho/client.py:364-368: the new automatic-pruning fields are neither resolved by from_global_config() nor consumed by a gateway caller; the advertised startup/24-hour behavior is not implemented.
  • The diff changes no tests (gh pr diff 33893 --name-only), leaving destructive classification and deletion paths uncovered.

Suggested changes

  • Separate confirmation bypass from any override for unknown timestamps, and default unknown timestamps to retention.
  • Remove or fully wire and test the automatic-pruning configuration.
  • Add fake-SDK tests for dry run, timestamp boundaries, unknown timestamps, confirmation, and partial deletion failures.

Automated hermes-sweeper review.

stale.append(entry)
elif age_days is None:
# No timestamp — too old to judge, skip unless --force
if force:

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.

--force is documented as skipping confirmation, but here it also makes an undated session eligible for deletion. Please retain sessions whose age cannot be established, or use a separate explicit override for that destructive behavior.

# stray HONCHO_API_KEY env var.
explicitly_configured: bool = False

# Session pruning — automatic cleanup of stale Honcho sessions.

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.

These fields are not populated by from_global_config() and this PR adds no gateway startup/periodic caller. Please either wire the documented automatic-pruning behavior end-to-end with tests or remove these unused fields from this manual-CLI PR.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data 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 area/sessions Session lifecycle, resume, persistence, history area/memory Memory subsystem: store, providers, sync, background reviews labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews area/sessions Session lifecycle, resume, persistence, history comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins 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 sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state tool/memory Memory tool and memory providers type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add observation pruning controls to Honcho memory provider

4 participants