Skip to content

Commit 983c634

Browse files
fix(webchat): create dashboard sessions from New Chat
1 parent fa0bfe9 commit 983c634

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ Docs: https://docs.openclaw.ai
423423
- Outbound/security: strip known internal runtime scaffolding such as `<system-reminder>` and `<previous_response>` at the final channel delivery boundary and keep Discord output on targeted tag stripping, so degraded harness replies cannot leak those tags to users. Fixes #73595. Thanks @gabrielexito-stack and @martingarramon.
424424
- Security/Telegram: load Telegram security adapters in read-only audit/doctor, audit malformed Telegram DM `allowFrom` entries even when groups are disabled, and keep allowlist DM audits from counting stale pairing-store senders, so public/shared-DM risk checks stay accurate. Refs #73698. Thanks @xace1825.
425425
- Plugins: remove hidden manifest, provider-owner, bootstrap, and channel metadata caches so plugin installs, manifest edits, and bundled-root changes are visible on the next metadata read while keeping runtime/module loader caches for actual plugin code. Thanks @shakkernerd.
426-
- Control UI/WebChat: create a fresh dashboard session from the New Chat button instead of resetting the current transcript with `/new`, while keeping explicit `/new` reset behavior, preserving in-progress composer edits during delayed session creation or when creation cannot safely switch sessions, and showing retry feedback while sessions are already refreshing. Carries forward #52042 and #52746. Thanks @bobashopcashier and @vincentkoc.
426+
- Control UI/WebChat: create a fresh dashboard session from the New Chat button instead of resetting the current transcript with `/new`, while keeping explicit `/new` reset behavior, preserving in-progress composer edits during delayed session creation or when creation cannot safely switch sessions, and showing clear retry feedback when creation is blocked, refreshing, or returns no new session. Carries forward #52042 and #52746. Thanks @bobashopcashier and @vincentkoc.
427427
- CLI/plugins: use plugin metadata snapshots for install slot selection and add opt-in plugin lifecycle timing traces, so plugin install avoids runtime-loading the plugin registry for metadata-only decisions. Thanks @shakkernerd.
428428
- fix(plugins): restrict bundled plugin dir resolution to trusted package roots. (#73275) Thanks @pgondhi987.
429429
- fix(security): prevent workspace PATH injection via service env and trash helpers. (#73264) Thanks @pgondhi987.

ui/src/ui/app-render.helpers.node.test.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,12 +660,29 @@ describe("createChatSession", () => {
660660
);
661661
});
662662

663-
it("shows retry feedback when creation is skipped without a session error", async () => {
663+
it("shows creation failure feedback when creation is skipped without a session error", async () => {
664664
const state = createChatSessionState({ lastError: "previous error" });
665665
createSessionAndRefreshMock.mockResolvedValue(null);
666666

667667
await createChatSession(state);
668668

669+
expect(createSessionAndRefreshMock).toHaveBeenCalledTimes(1);
670+
expect(state.sessionKey).toBe("agent:ops:main");
671+
expect(state.chatMessage).toBe("draft prompt");
672+
expect(state.sessionsError).toBeNull();
673+
expect(state.lastError).toBe("New Chat could not create a new session. Try again in a moment.");
674+
expect(loadChatHistoryMock).not.toHaveBeenCalled();
675+
});
676+
677+
it("keeps refresh feedback when a queued session refresh skips creation", async () => {
678+
const state = createChatSessionState({ lastError: "previous error" });
679+
createSessionAndRefreshMock.mockImplementation(async () => {
680+
state.sessionsLoading = true;
681+
return null;
682+
});
683+
684+
await createChatSession(state);
685+
669686
expect(createSessionAndRefreshMock).toHaveBeenCalledTimes(1);
670687
expect(state.sessionKey).toBe("agent:ops:main");
671688
expect(state.chatMessage).toBe("draft prompt");

ui/src/ui/app-render.helpers.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ const NEW_CHAT_ACTIVE_RUN_MESSAGE =
132132
"Start a new session after the active run or queued messages finish.";
133133
const NEW_CHAT_SESSIONS_LOADING_MESSAGE =
134134
"Session list is still refreshing. Try New Chat again in a moment.";
135+
const NEW_CHAT_CREATE_FAILED_MESSAGE =
136+
"New Chat could not create a new session. Try again in a moment.";
135137

136138
export function renderTab(state: AppViewState, tab: Tab, opts?: { collapsed?: boolean }) {
137139
const href = pathForTab(tab, state.basePath);
@@ -641,7 +643,11 @@ export async function createChatSession(state: AppViewState) {
641643
!canSwitchToNewChatSession(state)
642644
) {
643645
if (!nextSessionKey) {
644-
state.lastError = state.sessionsError ?? NEW_CHAT_SESSIONS_LOADING_MESSAGE;
646+
state.lastError =
647+
state.sessionsError ??
648+
(state.sessionsLoading
649+
? NEW_CHAT_SESSIONS_LOADING_MESSAGE
650+
: NEW_CHAT_CREATE_FAILED_MESSAGE);
645651
}
646652
return;
647653
}

0 commit comments

Comments
 (0)