Skip to content

feat: Compact CoT display - #2954

Open
RoyBA wants to merge 17 commits into
Chainlit:mainfrom
RoyBA:feat/compact-cot-display
Open

RoyBA wants to merge 17 commits into
Chainlit:mainfrom
RoyBA:feat/compact-cot-display

Conversation

@RoyBA

@RoyBA RoyBA commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds two new [UI] config options (cot_display and show_step_details) that give app developers control over how Chain of Thought steps are displayed in the chat interface.

ezgif-2cbe8b40b7b3e27d

Motivation

When an agent uses many tools sequentially, the default "list" display creates a long vertical stack of individual step accordions. This can overwhelm users who only care about the final result. The new compact mode provides a ChatGPT-style collapsible summary.

New Config Options

Added to .chainlit/config.toml under [UI]:

Option Values Default Description
cot_display "list" | "compact" "list" list = current behavior (each step as its own accordion). compact = all steps collapsed into one summary line.
show_step_details true | false true When false, steps render as flat labels without expandable input/output.

Compact Mode Behavior

  • Shows animated "Using {tool_name}" label while the run is active
  • Shows "Used N steps" (or "Used N tools" in tool_call cot mode) when complete
  • Clicking expands to reveal individual steps in a bordered list
  • Only activates when there are 2+ visible steps (single steps render normally)
  • Includes avatar matching the Message component pattern
  • Works with nested agent architectures (LangChain, LangGraph, LlamaIndex) where tools are wrapped under intermediate run steps

Changes

Backend:

  • config.py — Added cot_display and show_step_details to UISettings model + TOML template
  • translations/*.json — Added usedSteps and usedTools keys to all 23 language files

Frontend:

  • messageContext.ts / MessageContext.tsx — Added cotDisplay and showStepDetails to context
  • MessagesContainer/index.tsx / ReadOnlyThread.tsx — Wire config values into context
  • Messages/index.tsx — Compact mode branching logic for CL_RUN_NAMES handler
  • Messages/CompactSteps.tsx — New component for compact step summary
  • Messages/Message/Step.tsx — Respect showStepDetails to render flat label

Types:

  • libs/react-client/src/types/config.ts — Added TS types for new config fields

Testing

  • Backend: 784 tests pass (4 pre-existing failures unrelated to this PR)
  • Frontend: 32 unit tests pass
  • ESLint: Clean
  • Prettier: Clean
  • Manual: Tested with a 5-tool sequential demo app and a LangGraph ReAct agent in both list and compact modes

Backward Compatibility

Both options default to the existing behavior (list / true). No breaking changes — apps without these config keys behave identically to before.

⚠️ Translations: Existing apps with local .chainlit/translations/ files will see lint warnings for the new usedSteps/usedTools keys on startup. This only affects users who opt into cot_display = "compact". To pick up the new keys, delete the local .chainlit/translations/ folder and restart — Chainlit will regenerate it from the updated source. This follows the same pattern as all prior translation additions in this project.


Summary by cubic

Adds two [UI] config options that give app developers control over how Chain of Thought steps render: cot_display="compact" collapses multiple steps into one summary line instead of a vertical stack of accordions, and show_step_details=false preserves the collapsible step hierarchy while hiding input/output payloads. Both default to the existing behavior, so backward compatible.

  • Compact mode activates for 2+ visible steps (counted recursively), shows "Using {tool}" while running then "Used N steps/tools", and uses the last step's icon/avatar/error state in the summary; nested assistant messages lift to the root.
  • show_step_details=false renders leaf steps as flat labels while keeping the hierarchy expandable; in default list mode, message-only steps remain expandable.
  • New CompactSteps component; MessageContext gains cotDisplay/showStepDetails; read-only threads respect features.latex and dataPersistence; usedSteps/usedTools added to all locales.
  • Cypress coverage added for compact summary, recursive counting, nested messages, flat-mode hierarchy, and step icons.

Migration

  • To enable: set [UI] cot_display = "compact" and/or show_step_details = false in .chainlit/config.toml.
  • If you vendor .chainlit/translations/, delete the folder to regenerate and pick up usedSteps/usedTools.

Written for commit 4b15775. Summary will update on new commits.

Review in cubic

RoyBA added 2 commits June 10, 2026 17:06
Add two new UI configuration options for controlling Chain of Thought
step rendering:

- `cot_display`: "list" (default, current behavior) or "compact"
  (collapses all steps into a single summary accordion line like
  "Using search_web" / "Used 5 tools")
- `show_step_details`: boolean (default true). When false, steps
  render as flat labels without expandable input/output details.

New CompactSteps component groups step-type children under one
accordion with an animated "Using X" label while running and a
"Used N steps/tools" summary when complete.

Includes translations for all 23 supported languages.
- Add countVisibleSteps helper that walks the full step subtree,
  fixing compact mode not activating when tools are nested under
  intermediate agent/run steps (e.g. LangGraph, LangChain).
- In CompactSteps, use collectVisible for recursive count/naming
  and pass all step-type children to <Messages> so existing skip
  logic drills through intermediates to reach tools.
- Switch showUsing signal from isRunning to !hasAnswer (presence of
  assistant_message in subtree), preventing both the flash between
  sequential tools and the stale "Using" label during answer streaming.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 32 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread frontend/src/components/ReadOnlyThread.tsx
Comment thread backend/chainlit/translations/nl.json Outdated
…middelen'

feat(ReadOnlyThread): add support for latex and dataPersistence features
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 10, 2026
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 14 days with no activity.

@github-actions github-actions Bot added stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed and removed stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed labels Jun 25, 2026
@liebki

liebki commented Jul 11, 2026

Copy link
Copy Markdown

This looks nice!

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 14 days with no activity.

@github-actions github-actions Bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jul 26, 2026
Co-Authored-By: GitHub Copilot <noreply@github.com>
@github-actions github-actions Bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jul 29, 2026

@dokterbob dokterbob left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice job, very comprehensive, cool/useful new feature!

However, to be able to maintain it, we really kinda need ... E2E tests.
Any chance you could add a substantial/comprehensive E2E test for this feature? 🥺 🙏🏼

dokterbob and others added 3 commits July 29, 2026 15:48
Add Cypress coverage for the compact chain-of-thought display:
- collapses multiple steps into a single summary and expands on click
- leaves a single step uncollapsed
- counts nested steps recursively to trigger compact mode

Adds data-testid hooks to CompactSteps for stable selection.

Co-Authored-By: GitHub Copilot <noreply@github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cypress/e2e/compact_steps/spec.cy.ts
@RoyBA
RoyBA requested a review from dokterbob July 29, 2026 20:51
@RoyBA

RoyBA commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Nice job, very comprehensive, cool/useful new feature!

However, to be able to maintain it, we really kinda need ... E2E tests. Any chance you could add a substantial/comprehensive E2E test for this feature? 🥺 🙏🏼

Thanks! 🙏 Just pushed a comprehensive E2E test (compact_steps) covering:

  • multiple steps collapsing into one summary + expanding on click
  • a single step staying uncollapsed
  • nested steps counted recursively to trigger compact mode

I also added data-testid hooks to CompactSteps for stable selection. All 3 specs pass locally. Let me know if you'd like any additional cases covered!


@dokterbob

Copy link
Copy Markdown
Collaborator

Thanks! My time is limited... if 1 or (ideally) 2 community members could take this for a spin and report their experiences here I'd super appreciate! @liebki @lamylio perhaps?

@RoyBA Thanks for your responsiveness!

@dokterbob
dokterbob requested a review from Copilot July 30, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dokterbob

Copy link
Copy Markdown
Collaborator

@codex review

@lamylio

lamylio commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Thanks for the work on this, I tested it a bit and yup! I think it's a better way to display steps than before.

However I found two edge issues / unexpected (imo) behavioural difference :

  1. Nested assistant messages are visible by default, but hidden in compact mode

Test code snippet (part-of) :

@cl.step(type="tool", name="answering-agent")
async def answering_agent():
    await tool1();
    await tool2();
    await cl.Message(content="Nested final answer").send()

@cl.on_message
async def main(_message: cl.Message):
    await answering_agent();

In the existing list display, Message deliberately renders assistant-message children outside their parent step accordion. Consequently, an assistant reply remains visible even when the step that produced it is collapsed. (great)

Image 1: List mode (works properly)
image

In compact mode, non-message descendants are rendered inside CompactSteps’ accordion, while only direct message children are rendered outside it. An assistant message whose parent_id refers to a nested step therefore remains inside the compact accordion and is invisible until the summary is expanded.

Image 2 : Compact mode (unexpected)
image

  1. Nested steps disappear completely with show_step_details = false
@cl.step(type="tool", name="branch")
async def branch():
    await leaf()
    return "Branch result"

@cl.step(type="tool", name="root")
async def root():
    await branch()
    return "Root result"

@cl.on_message
async def main(_message: cl.Message):
    await root()
    await cl.Message(content="Final answer").send()

With the default show_step_details = true, root, branch, and leaf remain accessible by expanding their respective parent steps. When the option is set to false the parent is rendered as a flat label and its child steps are no longer rendered, at all.

List mode with show_step_details disabled only renders the root step

I personally would expect this option to remove the input/output accordion details while preserving the visible step hierarchy (or at least on one level), since the default behavior exposes those nested steps.

@dokterbob

Copy link
Copy Markdown
Collaborator

Thanks for extensive feedback @lamylio. @RoyBA What do you think of their suggestions/feedback?

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 14 days with no activity.

@github-actions github-actions Bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Aug 15, 2026
…lat CoT

Two behavioral asymmetries reported on the compact CoT display:

- Compact mode only lifted direct message children of a run to the root, so an
  assistant message emitted inside a nested step stayed trapped in the collapsed
  summary. Collect messages recursively and strip them from the accordion body.

- show_step_details=false dropped a step's whole subtree. Now it only hides the
  input/output payload: steps with sub-steps stay collapsible, leaves render as
  flat labels, preserving the (collapsible) hierarchy.

Adds E2E coverage: a nested-message case in compact_steps and a new step_details
spec.

Co-Authored-By: GitHub Copilot <noreply@github.com>
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 20, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 9 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cypress/e2e/compact_steps/spec.cy.ts
Comment thread frontend/src/components/chat/Messages/Message/Step.tsx
… assertion

- Step: a step whose children are all messages is no longer 'expandable' into
  an empty accordion — hasSubSteps now matches what the body renders (non-message
  children), consistent with nestedSteps.
- E2E: assert the nested message is absent from the compact summary after
  expanding it (Radix unmounts closed content, so the collapsed check was vacuous).

Co-Authored-By: GitHub Copilot <noreply@github.com>
@RoyBA

RoyBA commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

@lamylio nice catches, thank you 🙏 both repros were spot on. Fixed in c2ad12f8.

For the nested message one — the issue was compact mode only pulled the run's top-level messages out to the root, but your message was .send()'d from inside a nested step so it got stuck in the collapsed summary. Now I collect them recursively so they always end up at the root (and stripped them from the accordion body so there's no dupe). Behaves like list mode again.

For show_step_details=false — yeah that was just wrong, it was throwing away the whole subtree. I reworked it so the flag hides the payload and not the structure: steps that have sub-steps stay as normal (collapsible) accordions, just without the input/output inside, and actual leaves become flat labels.

Added E2E for both (nested-message case in compact_steps + a new step_details spec), existing ones still green.

@dokterbob lmk if that show_step_details behaviour is what you'd expect, easy to tweak 👍

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread frontend/src/components/chat/Messages/Message/Step.tsx Outdated
RoyBA and others added 2 commits August 20, 2026 22:58
The non-message sub-step filter must only gate flat-mode expandability. Applying
it to hasContent regressed default mode: a step whose children are all messages
(e.g. a run wrapping assistant messages) flattened and dropped its accordion
body, including MessageButtons. Keep hasContent based on any children; use the
non-message filter solely for the show_step_details=false branch.

Co-Authored-By: GitHub Copilot <noreply@github.com>
@github-actions github-actions Bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Aug 21, 2026

@dokterbob dokterbob left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Happy to merge this once (minor) merge conflicts are solved.

@RoyBA

RoyBA commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Happy to merge this once (minor) merge conflicts are solved.

Conflict resolved and merged latest main in, so it should be clean now. 🙏

@dokterbob
dokterbob enabled auto-merge August 26, 2026 09:47
@RoyBA
RoyBA requested a review from dokterbob August 26, 2026 10:30
@RoyBA

RoyBA commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @dokterbob. auto-merge seems blocked on your earlier "Requested changes" review

@lamylio

lamylio commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Hey, actually I've implemented this PR in a private fork, and upon testing it a bit more I came across another issue. It might be a personal taste, but the displayed parent step does not properly use the latest step's avatarName/iconName.

I personally simply fixed it like this:

# frontend/src/components/chat/Messages/CompactSteps.tsx
-   <MessageAvatar author={lastStep?.name || 'Assistant'} />
+   <MessageAvatar
+     author={lastStep?.name || 'Assistant'}
+     avatarName={lastStep?.metadata?.avatarName}
+     iconName={lastStep?.metadata?.icon}
+   />
# could be extended to isError also?

just so you know :)

Compact mode hardcoded the summary avatar to the step name, so custom step icons/avatars and error state were dropped (they showed in list mode only). Pass avatarName/icon/isError from the last step, mirroring the normal message path. Adds an E2E covering the icon case.

Co-Authored-By: GitHub Copilot <noreply@github.com>
auto-merge was automatically disabled September 1, 2026 18:44

Head branch was pushed to by a user without write access

@RoyBA

RoyBA commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Hey, actually I've implemented this PR in a private fork, and upon testing it a bit more I came across another issue. It might be a personal taste, but the displayed parent step does not properly use the latest step's avatarName/iconName.

I personally simply fixed it like this:

# frontend/src/components/chat/Messages/CompactSteps.tsx
-   <MessageAvatar author={lastStep?.name || 'Assistant'} />
+   <MessageAvatar
+     author={lastStep?.name || 'Assistant'}
+     avatarName={lastStep?.metadata?.avatarName}
+     iconName={lastStep?.metadata?.icon}
+   />
# could be extended to isError also?

just so you know :)

Good catch, thanks @lamylio 🙏 Fixed in 3ad243bb.

Also added an E2E covering the icon in the compact summary.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 14 days with no activity.

@github-actions github-actions Bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 16, 2026
Co-Authored-By: GitHub Copilot <noreply@github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

4 issues found across 39 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="backend/chainlit/translations/el-GR.json">

<violation number="1" location="backend/chainlit/translations/el-GR.json:104">
P2: The completed compact summary uses `Χρησιμοποίησε`, which reads as an instruction or an incomplete active clause rather than “Used N steps/tools.” Use the passive plural forms so the Greek status accurately describes the completed run.</violation>
</file>

<file name="frontend/src/components/chat/Messages/CompactSteps.tsx">

<violation number="1" location="frontend/src/components/chat/Messages/CompactSteps.tsx:72">
P2: When an assistant message is emitted before its parent run finishes, `showUsing` becomes false while `isRunning` is true, so the compact summary says “Used” during active work. Keep the running label until the parent run ends.</violation>
</file>

<file name="backend/chainlit/translations/ar-SA.json">

<violation number="1" location="backend/chainlit/translations/ar-SA.json:103">
P3: The Arabic strings hardcode the plural noun “خطوات/أدوات” for every count, but Arabic number–noun agreement depends on the value of {{count}}. Compact mode activates at 2+ visible steps, so count=2 (the most common case) renders “استُخدمت 2 خطوات”, which is ungrammatical — two takes the dual “خطوتان”, and numbers 11+ take the singular “خطوة”. Since `Translator` substitutes whatever count is passed, this wrong form shows for real users whenever 2 (or ≥11) steps/tools are used. Reword the string so it stays grammatical for any count (e.g. “الخطوات المستخدمة: {{count}}”), or add i18next plural variants (`usedSteps_two`/`usedSteps_few`/`usedSteps_many`) for this locale.</violation>
</file>

<file name="frontend/src/components/chat/MessagesContainer/index.tsx">

<violation number="1" location="frontend/src/components/chat/MessagesContainer/index.tsx:180">
P3: The new context fields were correctly added to the useMemo dependency array, but the same array still omits other values the memo body reads: `latex` (`config?.features?.latex`), `editable` (`config?.features.edit_message`), `onFeedbackDeleted`, and `uploadFile`. While the diff is extending this dependency array anyway, closing those gaps keeps all context fields in sync; as written, `latex`/`editable`/`onFeedbackDeleted` can serve stale values if the config or callbacks change (e.g., the initial `useConfig` load completing after a partial render). Compare with `ReadOnlyThread.tsx`, where the same change also added the previously missing `config?.features?.latex` and `config?.dataPersistence`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment on lines +104 to +105
"usedSteps": "Χρησιμοποίησε {{count}} βήματα",
"usedTools": "Χρησιμοποίησε {{count}} εργαλεία"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: The completed compact summary uses Χρησιμοποίησε, which reads as an instruction or an incomplete active clause rather than “Used N steps/tools.” Use the passive plural forms so the Greek status accurately describes the completed run.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/chainlit/translations/el-GR.json, line 104:

<comment>The completed compact summary uses `Χρησιμοποίησε`, which reads as an instruction or an incomplete active clause rather than “Used N steps/tools.” Use the passive plural forms so the Greek status accurately describes the completed run.</comment>

<file context>
@@ -100,7 +100,9 @@
         "using": "Με τη χρήση",
-        "used": "Χρησιμοποιήθηκε"
+        "used": "Χρησιμοποιήθηκε",
+        "usedSteps": "Χρησιμοποίησε {{count}} βήματα",
+        "usedTools": "Χρησιμοποίησε {{count}} εργαλεία"
       },
</file context>
Suggested change
"usedSteps": "Χρησιμοποίησε {{count}} βήματα",
"usedTools": "Χρησιμοποίησε {{count}} εργαλεία"
"usedSteps": "Χρησιμοποιήθηκαν {{count}} βήματα",
"usedTools": "Χρησιμοποιήθηκαν {{count}} εργαλεία"

return check(steps);
}, [steps]);

const showUsing = !!isRunning && !hasAnswer;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: When an assistant message is emitted before its parent run finishes, showUsing becomes false while isRunning is true, so the compact summary says “Used” during active work. Keep the running label until the parent run ends.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/chat/Messages/CompactSteps.tsx, line 72:

<comment>When an assistant message is emitted before its parent run finishes, `showUsing` becomes false while `isRunning` is true, so the compact summary says “Used” during active work. Keep the running label until the parent run ends.</comment>

<file context>
@@ -0,0 +1,151 @@
+      return check(steps);
+    }, [steps]);
+
+    const showUsing = !!isRunning && !hasAnswer;
+
+    // Get the last visible step name for the "Using X" label
</file context>

Comment on lines +103 to +104
"usedSteps": "استُخدمت {{count}} خطوات",
"usedTools": "استُخدمت {{count}} أدوات"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The Arabic strings hardcode the plural noun “خطوات/أدوات” for every count, but Arabic number–noun agreement depends on the value of {{count}}. Compact mode activates at 2+ visible steps, so count=2 (the most common case) renders “استُخدمت 2 خطوات”, which is ungrammatical — two takes the dual “خطوتان”, and numbers 11+ take the singular “خطوة”. Since Translator substitutes whatever count is passed, this wrong form shows for real users whenever 2 (or ≥11) steps/tools are used. Reword the string so it stays grammatical for any count (e.g. “الخطوات المستخدمة: {{count}}”), or add i18next plural variants (usedSteps_two/usedSteps_few/usedSteps_many) for this locale.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/chainlit/translations/ar-SA.json, line 103:

<comment>The Arabic strings hardcode the plural noun “خطوات/أدوات” for every count, but Arabic number–noun agreement depends on the value of {{count}}. Compact mode activates at 2+ visible steps, so count=2 (the most common case) renders “استُخدمت 2 خطوات”, which is ungrammatical — two takes the dual “خطوتان”, and numbers 11+ take the singular “خطوة”. Since `Translator` substitutes whatever count is passed, this wrong form shows for real users whenever 2 (or ≥11) steps/tools are used. Reword the string so it stays grammatical for any count (e.g. “الخطوات المستخدمة: {{count}}”), or add i18next plural variants (`usedSteps_two`/`usedSteps_few`/`usedSteps_many`) for this locale.</comment>

<file context>
@@ -99,7 +99,9 @@
         "using": "يستخدم",
-        "used": "مستخدم"
+        "used": "مستخدم",
+        "usedSteps": "استُخدمت {{count}} خطوات",
+        "usedTools": "استُخدمت {{count}} أدوات"
       },
</file context>
Suggested change
"usedSteps": "استُخدمت {{count}} خطوات",
"usedTools": "استُخدمت {{count}} أدوات"
"usedSteps": "الخطوات المستخدمة: {{count}}",
"usedTools": "الأدوات المستخدمة: {{count}}"

loading,
config?.ui?.name,
config?.ui?.cot,
config?.ui?.cot_display,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The new context fields were correctly added to the useMemo dependency array, but the same array still omits other values the memo body reads: latex (config?.features?.latex), editable (config?.features.edit_message), onFeedbackDeleted, and uploadFile. While the diff is extending this dependency array anyway, closing those gaps keeps all context fields in sync; as written, latex/editable/onFeedbackDeleted can serve stale values if the config or callbacks change (e.g., the initial useConfig load completing after a partial render). Compare with ReadOnlyThread.tsx, where the same change also added the previously missing config?.features?.latex and config?.dataPersistence.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/chat/MessagesContainer/index.tsx, line 180:

<comment>The new context fields were correctly added to the useMemo dependency array, but the same array still omits other values the memo body reads: `latex` (`config?.features?.latex`), `editable` (`config?.features.edit_message`), `onFeedbackDeleted`, and `uploadFile`. While the diff is extending this dependency array anyway, closing those gaps keeps all context fields in sync; as written, `latex`/`editable`/`onFeedbackDeleted` can serve stale values if the config or callbacks change (e.g., the initial `useConfig` load completing after a partial render). Compare with `ReadOnlyThread.tsx`, where the same change also added the previously missing `config?.features?.latex` and `config?.dataPersistence`.</comment>

<file context>
@@ -175,6 +177,8 @@ const MessagesContainer = ({ navigate }: Props) => {
     loading,
     config?.ui?.name,
     config?.ui?.cot,
+    config?.ui?.cot_display,
+    config?.ui?.show_step_details,
     config?.features?.unsafe_allow_html,
</file context>

@github-actions github-actions Bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 19, 2026

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

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants