Skip to content

feat: add option to hide subsessions in sessions list#4

Open
shiquda wants to merge 1 commit intogrinev:mainfrom
shiquda:feature/hide-subsessions
Open

feat: add option to hide subsessions in sessions list#4
shiquda wants to merge 1 commit intogrinev:mainfrom
shiquda:feature/hide-subsessions

Conversation

@shiquda
Copy link
Contributor

@shiquda shiquda commented Feb 15, 2026

Summary

  • add HIDE_SUBSESSIONS option to filter out child sessions from /sessions
  • keep parent session browsing behavior intact while reducing list noise
  • expose and document the option in runtime/config references

Add HIDE_SUBSESSIONS configuration option to filter out
child sessions (subsessions) from the /sessions command.

When enabled, only top-level sessions are shown, making it
easier to navigate when there are many subagent sessions.

Changes:
- Add HIDE_SUBSESSIONS env variable
- Filter sessions with parentID when option is enabled
- Add debug logging for filtered subsessions
- Update documentation

Environment variable:
- HIDE_SUBSESSIONS: Set to "true" to hide child sessions

if (sessions.length === 0) {
let filteredSessions = sessions;
if (config.bot.hideSubsessions) {
Copy link
Owner

Choose a reason for hiding this comment

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

Right now, child sessions are filtered out after fetching a limited list (limit).
With HIDE_SUBSESSIONS=true, this can produce incomplete results (or even an empty list) if many recent items are subsessions, even when root sessions exist beyond the current page.
Could we pass "roots: true" to "session.list()" when this option is enabled, and keep client-side filtering only as a fallback?
That would preserve correct "/sessions" behavior with any limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants