Skip to content

feat: /topic command for named sessions in private chats#88

Merged
royosherove merged 1 commit intomainfrom
feat/topic-sessions
May 10, 2026
Merged

feat: /topic command for named sessions in private chats#88
royosherove merged 1 commit intomainfrom
feat/topic-sessions

Conversation

@royosherove
Copy link
Copy Markdown
Member

Switch between independent conversation contexts in your DM:

/topic deploy — switch to 'deploy' topic
/topic debug — switch to 'debug' topic
/topic — show current topic
/topic main — return to default session

  • Each topic = separate agent session (memory, context)
  • Persisted to disk (survives restarts)
  • Topic override applied to /stop and /verbose too
  • 403 tests green (+7 new)

Switch between independent conversation contexts in your DM:
  /topic deploy    — switch to 'deploy' topic
  /topic debug     — switch to 'debug' topic
  /topic           — show current topic
  /topic main      — return to default session

Each topic gets its own agent memory and context.
Topic names sanitized to lowercase alphanumeric + hyphens.

396 tests green.
@royosherove royosherove merged commit 978f7eb into main May 10, 2026
1 check passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 222e377e4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (agentThreadId !== "main") return agentThreadId;
const chatId = thread.id?.split(":")[1] ?? thread.id ?? "";
const topic = getActiveTopic(String(chatId));
return topic ? `topic:${topic}` : agentThreadId;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Scope topic session IDs to chat

applyTopicOverride drops the chat identifier and returns only topic:<name> for all private chats, so two different users who pick the same topic name (for example /topic deploy) are routed into the same agent session. This breaks the per-chat isolation implied by activeTopics (keyed by chatId) and can leak context/history across users in multi-user allowlists; include chat identity in the derived session id (e.g., dm:<chatId>:topic:<name>) to keep sessions isolated.

Useful? React with 👍 / 👎.

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