Skip to content

feat: adopt existing agent-shell sessions instead of always creating#6

Open
Lenbok wants to merge 2 commits intocmacrae:mainfrom
Lenbok:feat-adopt-existing-project-agent-shell
Open

feat: adopt existing agent-shell sessions instead of always creating#6
Lenbok wants to merge 2 commits intocmacrae:mainfrom
Lenbok:feat-adopt-existing-project-agent-shell

Conversation

@Lenbok
Copy link
Copy Markdown

@Lenbok Lenbok commented Jan 16, 2026

When toggling the sidebar, check for existing agent-shell buffers in the current project that aren't registered with the sidebar and adopt them rather than creating new sessions. This allows users to manually create agent-shell sessions and have the sidebar reuse them.

  • Add agent-shell-sidebar--find-unregistered-buffers to search for unregistered agent-shell buffers by project root
  • Add agent-shell-sidebar--adopt-existing-session to register and mark an existing buffer as a sidebar session
  • Update agent-shell-sidebar--create-and-show-sidebar to try adoption before creating new sessions

Lenbok and others added 2 commits January 17, 2026 11:28
…new ones

When toggling the sidebar, check for existing agent-shell buffers in the
current project that aren't registered with the sidebar and adopt them
rather than creating new sessions. This allows users to manually create
agent-shell sessions and have the sidebar reuse them.

- Add agent-shell-sidebar--find-unregistered-buffers to search for
  unregistered agent-shell buffers by project root
- Add agent-shell-sidebar--adopt-existing-session to register and mark
  an existing buffer as a sidebar session
- Update agent-shell-sidebar--create-and-show-sidebar to try adoption
  before creating new sessions
- Fix agent-shell-sidebar--get-window to find actual sidebar window
  when buffer is shown in both sidebar and normal windows
- Remove window-size-fixed to avoid issues with buffer-local variable
  affecting all windows showing the buffer
- Add no-other-window parameter to make sidebar invisible to other-window
  when locked
- Update agent-shell-sidebar-locked docstring to reflect actual behavior
- Fix agent-shell-sidebar--display-buffer to avoid duplicate windows
  when converting sole window to sidebar
- Prevent 'same side but no common parent' errors by properly handling
  non-sidebar windows before creating sidebar
@Lenbok
Copy link
Copy Markdown
Author

Lenbok commented Mar 25, 2026

Added extra fixes related to problems when you intermingle use of agent-shell-sidebar-toggle with non-sidebar viewing of the agent shell buffer.

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