You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the only way to free a session slot is to wait for TTL expiry or restart agent-broker. Users have no way to manually end a session when they're done with a thread.
This becomes important when session_ttl_hours is set high (e.g. 7 days) to preserve context — sessions accumulate and can hit max_sessions.
Proposed Solution
Add a /close (and /end alias) command that users can type inside a thread to:
In discord.rs, intercept the command before passing to the ACP agent:
// In message handler, before get_or_create:if prompt.trim().eq_ignore_ascii_case("/close") || prompt.trim().eq_ignore_ascii_case("/end"){if in_thread {let thread_key = msg.channel_id.get().to_string();
pool.close_session(&thread_key).await?;
msg.channel_id.say(&ctx.http,"✅ Session closed.").await?;}return;}
In pool.rs, add a close_session method:
pubasyncfnclose_session(&self,thread_id:&str) -> Result<()>{letmut conns = self.connections.write().await;if conns.remove(thread_id).is_some(){info!(thread_id,"closed active session");}// Optionally clean up working directory and persisted mappingOk(())}
Additional Considerations
Could also support /status to show active session count / current thread info
The command should only work inside threads (not in the main channel)
Problem
Currently the only way to free a session slot is to wait for TTL expiry or restart agent-broker. Users have no way to manually end a session when they're done with a thread.
This becomes important when
session_ttl_hoursis set high (e.g. 7 days) to preserve context — sessions accumulate and can hitmax_sessions.Proposed Solution
Add a
/close(and/endalias) command that users can type inside a thread to:Implementation
In
discord.rs, intercept the command before passing to the ACP agent:In
pool.rs, add aclose_sessionmethod:Additional Considerations
/statusto show active session count / current thread infoWe've tested this locally and it works well. Happy to submit a PR.