Skip to content

feat(workspace): improve conversation and feedback workflows - #960

Merged
wanghaojie124 merged 4 commits into
OpenCSGs:mainfrom
wanghaojie124:dev
Nov 26, 2026
Merged

wanghaojie124 merged 4 commits into
OpenCSGs:mainfrom
wanghaojie124:dev

Conversation

@wanghaojie124

Copy link
Copy Markdown
Collaborator
  • Persist composer drafts across navigation and reloads, and clear them after successful submission or explicit discard.
  • Add linked agent and directory filters, fix cloud conversation menu routes, and show the current theme in the account menu.
  • Align feedback attachment controls and validation messages with the demo.
  • Return missing image model configuration through the tool result and localize image retry feedback.
  • Limit long reasoning output to a collapsible, scrollable panel that follows streaming text.

- Persist composer drafts across navigation and reloads, and clear them after successful submission or explicit discard.
- Add linked agent and directory filters, fix cloud conversation menu routes, and show the current theme in the account menu.
- Align feedback attachment controls and validation messages with the demo.
- Return missing image model configuration through the tool result and localize image retry feedback.
- Limit long reasoning output to a collapsible, scrollable panel that follows streaming text.

@xxx7xxxx xxx7xxxx 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.

Two workflow regressions are detailed inline.

const collaborationModeID = useId();
const { title: modeTitle, hint: modeHint, icon: ModeIcon } = collaborationModes[collaborationMode];
const [resources, setResources] = useState<ResourceSnapshot[]>([]);
const draftKey = composerDraftKey(controller.sidebarProps?.currentUserID ?? "");

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.

Keep new-task drafts with their intended recipient. If I type a prompt and attach a file for Agent A, then select New task with agent from Agent B’s history, B’s composer opens with A’s text and file already attached. I reproduced this in Chrome and verified that submitting creates the room for B and includes A’s file in the message. Scope the draft to the recipient and workspace, or restore its original recipient and workspace with it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 8d63f38. New-task drafts are scoped to the recipient and workspace, including prompt text and attachments. Switching to another Agent or directory opens that scope’s draft, and switching back restores the original. Added regression coverage for both cases.

];
const label = retryable
? t(knownErrors.includes(errorKey) ? errorKey : "image_generation_failed")
if (state === "failed" && errorKey === "image_model_not_configured") {

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.

Keep Regenerate available for saved failures after an image model is configured. For a historical task with no stored model, the retry path in engine.go loads the agent’s current image model. I verified that this path succeeds with the saved prompt, but this early return hides the button even after setup. Please retain the retry action alongside the localized guidance for those tasks.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 8d63f38. Historical failures without a stored model now show the localized setup guidance alongside Regenerate. Clicking Regenerate calls the existing retry endpoint for the saved task. Added a regression test for that action.

@xxx7xxxx xxx7xxxx 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.

I also verified a history filtering slowdown.

const optionsError = optionPages.isError;
const fetchOptionsPage = optionPages.fetchNextPage;
useEffect(() => {
if (filterOpen && optionPages.hasNextPage && !optionPages.isFetching && !optionPages.isFetchNextPageError)

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.

Opening the filter waits until every history page has loaded before any choices appear. In Chrome with 1,000 fixture conversations, the popover made 50 history requests and took about 9 seconds to show its first choices, with 100 ms of delay on each additional page. The real /api/v1/conversations handler also lists and sorts the full history on each request before slicing the page. Please fetch agent and directory counts in one server request so the filter can open without paging through the history.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 8d63f38. The filter popover now loads grouped Agent and directory counts in one request. In Chrome with 1,000 fixture conversations, opening the popover made one counts request and zero additional history-page requests.

@xxx7xxxx xxx7xxxx 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.

Two cases from the follow-up are detailed inline.

const workspaceAgentID = workspaceAgent?.id || "";
const draftKey =
createdDraftKey.current ??
startTaskDraftKey(

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.

Keep the active draft scope stable during loading and reloads. In Chrome, delaying the agent list let me type on /new before the default recipient loaded. The text was saved under agent: and vanished when the default agent appeared. After selecting another agent and typing a new draft, refreshing /new reset the recipient and displayed an empty composer until I picked the agent again. Keep early input until a real recipient is available, and restore the selected recipient and workspace when reloading the draft.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 31c3778. Text entered before the default Agent loads is preserved and moved into its draft once the Agent is available. Reloading the same page restores the selected Agent, working directory, and draft. Verified both paths in Chrome and added regression tests.

const fetchNextPage = list.fetchNextPage;
useEffect(() => {
if (directory && rooms.length < 20 && list.hasNextPage && !list.isFetchingNextPage && !list.isFetchNextPageError)
if (filtering && rooms.length < 20 && list.hasNextPage && !list.isFetching && !list.isFetchNextPageError)

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.

Apply the selected filter before paginating history. I confirmed the popover opens with a single counts request. Choosing an agent with one conversation at the end of 1,000 fixture conversations then fetched 49 additional unfiltered pages and took 5.6 seconds to show the match with 100 ms of delay per page. The list endpoint still scans and sorts the full history for each page. Returning a page of matches from the server would make the filter usable for sparse results.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 31c3778. The history endpoint applies Agent and directory filters before sorting and paginating matches. In Chrome with 1,000 fixture conversations, selecting a filter with one match returned it in one filtered request at offset 0, with zero additional unfiltered pages.

@xxx7xxxx xxx7xxxx 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.

I reproduced one draft isolation issue while the agent list is loading.

const workspaceAgentID = workspaceAgent?.id || "";
const userID = sidebar?.currentUserID ?? "";
const awaitingAgent = selected.startsWith("agent:") && !selectedAgent;
const pendingDraftKey = startTaskDraftKey(userID, `pending:${target || "default"}`);

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.

Keep pending drafts scoped to their workspace. With two Chrome tabs set to the same agent and different directories, I reloaded Project A with the agent list delayed and typed a prompt. Reloading Project B while A was still loading appended A’s text to B’s existing draft. Both tabs use the same pending key because it includes the target but omits the directory. Include the known workspace in the pending key so each workspace only picks up its own text.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in cd18c91. Pending drafts now include the known working directory in their storage key. The regression test reproduces Project B picking up Project A’s text while both use the same Agent, then verifies that each project retains only its own draft. All 60 StartTaskPage tests and TypeScript checks passed.

@wanghaojie124
wanghaojie124 merged commit 3767ab9 into OpenCSGs:main Nov 26, 2026
1 check 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.

2 participants