Skip to content

Add contextual side conversations to Community Edition - #243

Merged
Luhaozhu merged 1 commit into
mainfrom
sync/ce-20261130-side-chats
Dec 1, 2026
Merged

Luhaozhu merged 1 commit into
mainfrom
sync/ce-20261130-side-chats

Conversation

@Luhaozhu

Copy link
Copy Markdown
Contributor

Purpose and behavior

  • Before: A follow-up entered the main conversation or needed a separate fork. Old tool results could also attach a previous turn's file again, and internet search had no preferred-domain setting.
  • After: Users can ask a contextual question in a compact side conversation, reopen it from the parent, and explicitly quote text back. The conversation rail uses turn dots on the left. Run completion considers current tool results, and search can prioritize configured domains. The unused classification endpoint is removed.

Change walkthrough

  • Flow: src/frontend/src/components/chat/selection/messageSelectionActions.tsx and src/frontend/src/components/canvas/SideChatPanel.tsx call the side-chat API. src/backend/api/routes/v1/side_chats.py delegates ownership checks, creation and listing to src/backend/core/chat/side_chats.py. Migration ce_0050 links child sessions to their parent, and src/backend/core/llm/context/parent_background.py provides background to the agent. src/backend/core/llm/context/workspace_hooks.py records file candidates after each tool call. The internet-search MCP merges preferred-host and general results.
  • Decisions: Side chats reuse conversation and streaming primitives and store their history in child sessions. Parent background and explicitly quoted text have different roles. The sync applies the generated CE delta to public main and preserves existing public-only changes.

Risk and compatibility

  • Risk: high
  • Boundaries: The nullable indexed parent key adds a cascade for child sessions. The chat UI, ownership checks, workspace artifact behavior, search providers and API documentation change. Existing integrations that call /v1/classify must remove that call.
  • Human review: Check side-chat ownership, access after parent deletion and data retention, and whether any external consumers depend on the retired endpoint.

Verification

  • Evidence: The CE generator gates passed. The PR tree passed git diff --cached --check, the Node 22 frontend production build, and 71 targeted Python tests covering side chats, workspace pins, batched search and subagents. Alembic reports ce_0050 as its single head.
  • Limits: The targeted run excludes the full test suite, native CE packaging and an upgrade against a live CE PostgreSQL database.

Recovery

  • Steps: Revert the application changes if needed and preserve the additive database revision until any child sessions created after upgrade have been assessed. Take a database backup before considering schema downgrade, which drops the parent linkage.

Review follow-up

  • Disposition: Initial review pending.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T10:22:51.517140Z 9b4d0c3 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 9b4d0c32e1

ℹ️ 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".

Comment on lines +31 to +34
# It is the first message, or the second behind an in-memory fallback summary.
for index, message in enumerate(messages[:2]):
if is_parent_background(message):
return message, [*messages[:index], *messages[index + 1 :]]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Find parent background after injected session blocks

When a side chat has both a user-identity block and a frozen-memory block, inject_session_blocks() prepends both before the parent background. During mid-turn compaction, _history_for_summary() therefore places the background at index 2, outside this search. The background then enters run_compaction() and gets persisted in the child's checkpoint; subsequent turns prepend the live parent context again, duplicating parent information and retaining stale facts after parent edits. Search past the session blocks rather than assuming the background occupies one of the first two positions, and cover the identity-plus-memory case in the split test.

Useful? React with 👍 / 👎.

Comment on lines +167 to +171
reopen: (sideId) => {
const side = findSideChat(sideId);
if (!side) return;
seedChatItem(side);
openTab(side);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the initial quote when reopening an empty side chat

If someone creates a side chat from a selection, refreshes before sending its first message, and reopens it from the parent, the selected passage is no longer supplied with the question. open() initializes quotedFollowUp, but composer drafts are memory-only and this reopening path never restores it. The panel still displays the saved quote in its header, while streamSend sends no quoted_follow_up and the backend injects only the broader parent transcript, so questions such as “what does this mean?” lose their selected referent. Restore the saved quote for a genuinely empty side chat on reopening, or attach it server-side when admitting the first turn.

Useful? React with 👍 / 👎.

@Luhaozhu
Luhaozhu merged commit eb03d1a into main Dec 1, 2026
6 checks passed
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