Skip to content

fix(session): prevent dispatch args leaking as parent_id in select_session#356

Merged
sudo-tee merged 1 commit intosudo-tee:mainfrom
hermandavid:fix/select-session-dispatch-args-leak
Apr 12, 2026
Merged

fix(session): prevent dispatch args leaking as parent_id in select_session#356
sudo-tee merged 1 commit intosudo-tee:mainfrom
hermandavid:fix/select-session-dispatch-args-leak

Conversation

@hermandavid
Copy link
Copy Markdown
Contributor

Problem

After the commands refactor (#337), the dispatch layer calls all execute functions with the signature execute(args, range). The select_session keymap alias was directly referencing M.actions.select_session, which interprets its first parameter as parent_id.

When triggered via keymap with no arguments, dispatch passes {} (empty args table) as the first argument. This causes core.select_session to filter sessions where s.parentID == {}, which never matches — every session is filtered out, and the user always sees "No child sessions found".

The /sessions slash command was unaffected because it routes through the session command handler, which calls M.actions.select_session() without arguments.

Fix

Wrap the execute binding so dispatch args are not forwarded as parent_id, matching the pattern already used by rename_session on the adjacent line.

@hermandavid hermandavid force-pushed the fix/select-session-dispatch-args-leak branch from b45afc9 to dea95be Compare April 11, 2026 10:59
@sudo-tee
Copy link
Copy Markdown
Owner

Thanks for the fix

@sudo-tee sudo-tee merged commit 1758b92 into sudo-tee:main Apr 12, 2026
5 checks passed
@hermandavid hermandavid deleted the fix/select-session-dispatch-args-leak branch April 16, 2026 22:36
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