Files
PaperClipAI/ui
DottaandPaperclip 955501a75a fix(ui): do not render fast_response comments as New session markers (#23778)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Agent Chat renders conversation comments through
`commentsToTaskChatItems` in the task-chat UI adapter.
> - Fast-response acknowledgements (added in #15748) store
`conversationSessionGeneration` on `issue_comments` (including `0`) to
track which session they belong to.
> - The UI adapter treated any comment with
`conversationSessionGeneration != null` as a `/new` session-start
divider.
> - As a result, fast-response acknowledgements disappeared and rendered
as "New session · Earlier messages and files are still available."
dividers even when the user never ran `/new`.
> - This pull request narrows session-start marker detection so only
non-fast-response comments with `conversationSessionGeneration > 0`
render as session-start dividers.
> - The benefit is that fast-response acknowledgements display as agent
bubbles while real `/new` resets keep their session divider.

## Linked Issues or Issue Description

Refs #15748

**What happened?**

In Agent Chat, when Experimental Fast Responses is enabled, sending a
normal message causes a "New session · Earlier messages and files are
still available." divider to appear immediately after the user message,
even though the user never sent `/new` and the conversation session
generation stayed at `0`.

**Expected behavior**

Fast-response acknowledgements render as normal `fast_response` agent
bubbles. Only `/new` session-reset boundary comments render as "New
session" dividers.

**Steps to reproduce**

1. Enable Experimental Fast Responses on an instance and configure a
fast-response model.
2. Open an Agent Chat thread and send a normal message (not `/new`).
3. Observe that the `origin: "fast_response"` acknowledgement comment
has `conversationSessionGeneration: 0` (or the current generation `>=
1`) and renders as a "New session" marker instead of the acknowledgement
text.

**Paperclip version or commit**

Reproduced on `master` (commit `314bc70c1`).

**Deployment mode**

Self-hosted server

## What Changed

- Export `isConversationSessionStartComment` in
`ui/src/components/task-chat/task-chat-adapter.ts`, requiring
`comment.origin !== "fast_response"` and `typeof
comment.conversationSessionGeneration === "number" &&
comment.conversationSessionGeneration > 0`.
- Use `isConversationSessionStartComment` in `commentsToTaskChatItems`
(`ui/src/components/task-chat/task-chat-adapter.ts`) and in
`isHistoricalNotice`
(`ui/src/components/task-chat/status-relevance.ts`).
- Add regression unit tests in
`ui/src/components/task-chat/task-chat-adapter.test.ts` covering
`fast_response` comments in generation `0` and generation `1`, real
`/new` session boundaries in generation `1`, and non-reset
generation-`0` comments.

## Verification

- Verified red before the fix and green after the fix with `pnpm vitest
run ui/src/components/task-chat/task-chat-adapter.test.ts
ui/src/components/task-chat/status-relevance.test.ts
ui/src/components/TaskChatThread.test.tsx` (3 test files passed, 469
passed, 1 skipped).
- Verified UI typecheck with `pnpm --filter @paperclipai/ui typecheck`
(passed).

## Risks

Low risk. Only `/new` boundary comments ever stamp a positive
`conversationSessionGeneration` on a non-`fast_response` comment
(`issues.conversationSessionGeneration` starts at `0` and `/new`
increments it before writing the boundary comment). Existing
`fast_response` rows already stored in Postgres immediately render
properly with no migration required.

## Model Used

Google Gemini (Antigravity, medium reasoning effort, with code
execution, file editing, and read-only browser inspection).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-04 15:54:56 -06:00
..
…

@paperclipai/ui

Published static assets for the Paperclip board UI.

What gets published

The npm package contains the production build under dist/. It does not ship the UI source tree or workspace-only dependencies.

Storybook

Storybook config, stories, and fixtures live under ui/storybook/.

pnpm --filter @paperclipai/ui storybook
pnpm --filter @paperclipai/ui build-storybook

Typical use

Install the package, then serve or copy the built files from node_modules/@paperclipai/ui/dist.

Editor dependency identity

Keep the root and workspace overrides for @codemirror/state, @codemirror/view, and @lezer/common aligned. CodeMirror requires shared extension identity, while Lezer parsers and syntax highlighters require shared NodeProp IDs. Multiple Lezer copies can crash code-block highlighting with tags is not iterable. src/lib/codemirror-single-instance.test.ts checks the installed dependency graph and highlights sample code through the editor's real language dependencies. GitHub Actions owns regeneration of pnpm-lock.yaml.