Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 6e0af18

Browse files
committed
Show active model in chat footer
1 parent 9d76c07 commit 6e0af18

6 files changed

Lines changed: 64 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Show the current model in the Roo Code chat input footer.

packages/types/src/vscode-extension-host.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ export type ExtensionState = Pick<
314314
currentTaskItem?: HistoryItem
315315
currentTaskTodos?: TodoItem[] // Initial todos for the current task
316316
apiConfiguration: ProviderSettings
317+
currentModelId?: string
317318
uriScheme?: string
318319
shouldShowAnnouncement: boolean
319320

src/core/webview/ClineProvider.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,6 +2129,7 @@ export class ClineProvider
21292129

21302130
const {
21312131
apiConfiguration,
2132+
currentModelId,
21322133
lastShownAnnouncementId,
21332134
customInstructions,
21342135
alwaysAllowReadOnly,
@@ -2242,6 +2243,7 @@ export class ClineProvider
22422243
return {
22432244
version: this.context.extension?.packageJSON?.version ?? "",
22442245
apiConfiguration,
2246+
currentModelId,
22452247
customInstructions,
22462248
alwaysAllowReadOnly: alwaysAllowReadOnly ?? false,
22472249
alwaysAllowReadOnlyOutsideWorkspace: alwaysAllowReadOnlyOutsideWorkspace ?? false,
@@ -2395,6 +2397,8 @@ export class ClineProvider
23952397
providerSettings.apiProvider = apiProvider
23962398
}
23972399

2400+
const currentModelId = getModelId(providerSettings)
2401+
23982402
let organizationAllowList = ORGANIZATION_ALLOW_ALL
23992403

24002404
try {
@@ -2471,6 +2475,7 @@ export class ClineProvider
24712475
// Return the same structure as before.
24722476
return {
24732477
apiConfiguration: providerSettings,
2478+
currentModelId,
24742479
lastShownAnnouncementId: stateValues.lastShownAnnouncementId,
24752480
customInstructions: stateValues.customInstructions,
24762481
apiModelId: stateValues.apiModelId,

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
9999
cloudUserInfo,
100100
enterBehavior,
101101
lockApiConfigAcrossModes,
102+
currentModelId,
102103
} = useExtensionState()
103104

104105
// Find the ID and display text for the currently selected API configuration.
@@ -110,6 +111,28 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
110111
}
111112
}, [listApiConfigMeta, currentApiConfigName])
112113

114+
const currentModelDisplayName = useMemo(() => {
115+
if (!currentModelId) {
116+
return undefined
117+
}
118+
119+
return currentModelId
120+
.split(/[-_\s]+/)
121+
.filter(Boolean)
122+
.map((part) => {
123+
if (part.toLowerCase() === "deepseek") {
124+
return "DeepSeek"
125+
}
126+
127+
if (/^v\d+$/i.test(part)) {
128+
return part.toUpperCase()
129+
}
130+
131+
return part.charAt(0).toUpperCase() + part.slice(1)
132+
})
133+
.join(" ")
134+
}, [currentModelId])
135+
113136
const [gitCommits, setGitCommits] = useState<any[]>([])
114137
const [showDropdown, setShowDropdown] = useState(false)
115138
const [fileSearchResults, setFileSearchResults] = useState<SearchResult[]>([])
@@ -1320,6 +1343,14 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
13201343
lockApiConfigAcrossModes={!!lockApiConfigAcrossModes}
13211344
onToggleLockApiConfig={handleToggleLockApiConfig}
13221345
/>
1346+
{currentModelDisplayName ? (
1347+
<div
1348+
className="flex h-5 max-w-[160px] min-w-0 flex-shrink items-center rounded-sm border border-vscode-input-border/60 px-1.5 text-vscode-descriptionForeground"
1349+
title={currentModelId}
1350+
data-testid="current-model-indicator">
1351+
<span className="truncate text-xs leading-none">{currentModelDisplayName}</span>
1352+
</div>
1353+
) : null}
13231354
<AutoApproveDropdown triggerClassName="min-w-[28px] text-ellipsis overflow-hidden flex-shrink" />
13241355
</div>
13251356
<div

webview-ui/src/components/chat/__tests__/ChatTextArea.spec.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,27 @@ describe("ChatTextArea", () => {
8989
})
9090
})
9191

92+
describe("current model indicator", () => {
93+
it("shows the model id from extension state in the footer", () => {
94+
;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
95+
filePaths: [],
96+
openedTabs: [],
97+
apiConfiguration: {
98+
apiProvider: "deepseek",
99+
},
100+
currentModelId: "deepseek-v4-pro",
101+
taskHistory: [],
102+
cwd: "/test/workspace",
103+
})
104+
105+
render(<ChatTextArea {...defaultProps} />)
106+
107+
const indicator = screen.getByTestId("current-model-indicator")
108+
expect(indicator).toHaveTextContent("DeepSeek V4 Pro")
109+
expect(indicator).toHaveAttribute("title", "deepseek-v4-pro")
110+
})
111+
})
112+
92113
describe("handleEnhancePrompt", () => {
93114
it("should send message with correct configuration when clicked", () => {
94115
const apiConfiguration = {

webview-ui/src/context/ExtensionStateContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export const mergeExtensionState = (prevState: ExtensionState, newState: Partial
192192
export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
193193
const [state, setState] = useState<ExtensionState>({
194194
apiConfiguration: {},
195+
currentModelId: undefined,
195196
version: "",
196197
clineMessages: [],
197198
taskHistory: [],

0 commit comments

Comments
 (0)