Skip to content

🕰️ fix: Send a Side Chat's Turns as Temporary Only When Its Own Conversation Is - #18455

Draft
danny-avila wants to merge 2 commits into
devfrom
danny-avila/side-chat-temporary-flag
Draft

danny-avila wants to merge 2 commits into
devfrom
danny-avila/side-chat-temporary-flag

Conversation

@danny-avila

Copy link
Copy Markdown
Collaborator

Summary

A turn sent in a side chat is posted as temporary whenever the chat on screen is a temporary one. Open a new chat, switch Temporary Chat on, open a saved conversation beside it from the sidebar, and send a message there: the request for the saved conversation carries isTemporary: true.

Whether a turn is temporary came from the page's setting for every pane. The route keeps that setting in step with the conversation main chat shows, so it describes main chat's conversation and nothing else. The side chat (#18417) builds its turns with the same services, at its own pane, and took the setting as its own.

The server takes the stored conversation's flag ahead of the request's when the record has one, so the saved conversation in the reproduction stayed saved. A record that stores no flag has only the request to go by.

With this change a pane other than main chat's two sends its turns as temporary when the conversation it holds is temporary (including one stored with only a deadline), or when the deployment forces temporary retention. Main chat is unchanged.

Related to #18417.

How it works

-  const { isTemporary, config, auth, getEphemeralAgent } = settings;
+  const { config, auth, getEphemeralAgent } = settings;
-  const addedConversation = index === 0 || index === 1 ? settings.addedConversation : null;
+  const ridesMainChat = index === 0 || index === 1;
+  const addedConversation = ridesMainChat ? settings.addedConversation : null;
+  const isTemporary = ridesMainChat
+    ? settings.isTemporary
+    : isTemporaryConversation(conversation) || isForcedTemporaryRetention(config.retentionMode);

It is the same split useTurnServices already makes for the conversation main chat is compared with: what belongs to main chat's turns stays with panes 0 and 1.

Type of change

  • Bug fix

Testing

Reproduced in a real browser on the mock e2e lane before the change: with a temporary new chat on screen, the side chat's start request for a saved conversation posted isTemporary: true; the stored conversation and its messages read back isTemporary: false with no expiredAt.

Both new tests were run without the fix and fail there (Expected: false, Received: true).

Tested environments/configuration:

  • Chromium via Playwright, mock e2e lane (in-memory MongoDB, fake model), desktop 1440×900.

Automated tests:

  • client: new case in src/hooks/Chat/__tests__/services.readCodeInputs.spec.tsx (a saved conversation beside a temporary main chat, a temporary one beside a saved main chat, a record with only a deadline, forced retention).
  • New scenario @scenario:side-chat-turn-is-not-temporary-beside-a-temporary-chat in e2e/specs/mock/scenarios/side-chat-open-beside.spec.ts.
  • npx jest src/hooks/Chat in client: 20 of 21 suites pass. target.spec.tsx fails two cases locally with ECONNREFUSED 127.0.0.1:3080 (a real request leaves the test); it does not import the changed file and the same suite passes in CI on dev, so I am leaving it to this PR's CI run to confirm.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Head: 2c08bbc

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T20:15:09.052296Z 40d46fa Manual request
ℹ️ 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 2c08bbce1a

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

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Head: 40d46fa

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 40d46fa346

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

This branch has not been deployed

No deployments
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