Skip to content

feat: implement session context switching via /session command#335

Open
Tuzfucius wants to merge 10 commits intosipeed:mainfrom
Tuzfucius:session_function
Open

feat: implement session context switching via /session command#335
Tuzfucius wants to merge 10 commits intosipeed:mainfrom
Tuzfucius:session_function

Conversation

@Tuzfucius
Copy link
Contributor

Description

This PR introduces the ability for users to maintain and seamlessly switch between multiple isolated conversation contexts.

It builds upon the slash command infrastructure introduced in my previous PR (#182) and addresses the feature request discussed in #162.

  • Add SessionCommand with subcommands: new, switch, ls, remove
  • Implement persistent user-session mapping in state.Manager
  • Update SessionManager to support listing and deleting session files
  • Update AgentLoop to dynamically resolve session keys based on active user context
  • Enable isolated conversation contexts per user across all channels

Related Issues

- Create `pkg/command` package to host command interfaces and registry.
- Implement `Command` and `Registry` interfaces for extensible command parsing.
- Move basic commands (`/show`, `/list`, `/switch`) and add `/start`, `/help` to `pkg/command/basic.go`.
- Update `AgentLoop` to use `command.Registry` instead of hardcoded switch-case logic.
- Inject `ChannelManager` into `AgentLoop` to support channel-related commands.
- Resolve code duplication in `pkg/agent/loop.go`.
- Refactor Telegram channel to use the generic command system, removing duplicated command handling logic from `pkg/channels/telegram.go` and deleting `pkg/channels/telegram_commands.go`.
- Add SessionCommand with subcommands: `new`, `switch`, `ls`, `remove`
- Implement persistent user-session mapping in `state.Manager`
- Update SessionManager to support listing and deleting session files
- Update AgentLoop to dynamically resolve session keys based on active user context
- Enable isolated conversation contexts per user across all channels
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.

1 participant

Comments