Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(mode): re-enable /mode command and always show mode in status bar

ldstyle809cd90e012f7
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/mode.ts b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/mode.ts
index 375198f8df..e746e3ba02 100644
--- a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/mode.ts
+++ b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/mode.ts
@@ -51,10 +51,9 @@ export function createModeCommand(): SlashCommand {
return {
name: "mode",
description: "Switch chat mode",
- usage: "/mode <agent|code|code.normal|code.team|team|team.normal>",
+ usage: "/mode <agent|code|code.plan|code.normal|code.team|team|team.plan>",
example: "/mode code",
kind: CommandKind.BUILT_IN,
- hidden: true,
takesArgs: true,
completion: async () => [...directModes],
action: async (ctx, args) => {
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/event-handlers.ts b/jiuwenswarm/channels/tui/frontend/src/core/event-handlers.ts
index d594ed526d..625dd9bfe5 100644
--- a/jiuwenswarm/channels/tui/frontend/src/core/event-handlers.ts
+++ b/jiuwenswarm/channels/tui/frontend/src/core/event-handlers.ts
@@ -230,11 +230,6 @@ function _getToolResultPayload(payload: Record<string, unknown>): Record<string,
return payload;
}
-function normalizeVisibleMode(mode: ClientMode): ClientMode {
- if (mode === "team.plan") return "team";
- return mode;
-}
-
function _extractPathFromToolResult(
payload: Record<string, unknown>,
pathKeys: string[],
@@ -1303,7 +1298,7 @@ export function handleIncomingFrame(delegate: AppEventDelegate, frame: EventFram
case "session.updated": {
const mode = typeof payload.mode === "string" ? payload.mode : "";
if (isClientMode(mode)) {
- delegate.setMode(normalizeVisibleMode(mode));
+ delegate.setMode(mode);
}
if (typeof payload.title === "string") {
delegate.setSessionTitle(payload.title);
diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts b/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts
index 7b80385ea0..88f4c97aee 100644
--- a/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts
+++ b/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts
@@ -123,7 +123,7 @@ function buildStatusLines(
const displayTitle = raw.length > 30 ? raw.slice(0, 30) + "..." : raw;
left.push(displayTitle);
}
- if (snapshot.mode !== "agent.plan") left.push(`mode:${snapshot.mode}`);
+ left.push(`mode:${snapshot.mode}`);
if (snapshot.transcriptFoldMode !== "none") left.push(`fold:${snapshot.transcriptFoldMode}`);
const teamWorking =
isTeamMode(snapshot.mode) &&