Skip to content

Commit b92a7bc

Browse files
committed
Bring in the core review fixes
# Conflicts: # app/src/skins/openmuse/screens/apps.tsx
2 parents 9838a71 + 6afb431 commit b92a7bc

50 files changed

Lines changed: 2062 additions & 268 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ jobs:
132132
- run: bun install --frozen-lockfile
133133
- run: bun install --frozen-lockfile
134134
working-directory: agent-computer
135-
- run: bunx playwright install --with-deps chromium
135+
# `--no-shell` as the image does, so the headless run below proves nothing needs the shell.
136+
- run: bunx playwright install --with-deps --no-shell chromium
136137
working-directory: agent-computer
137138
# Headless here: these launch through the profile path without the computer's own X server.
138139
# The headless run of the Web Bot Auth test is also the one that checks the user agent fix.

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,17 @@ the spot: the step showed "Didn't work" and the Bot said nothing more. The failu
200200
Bot like any other result, so it can take a fresh snapshot, try another way, or tell you what
201201
stopped it. A refused step reads as a refusal the Bot can explain.
202202

203+
### The computer image is about a fifth smaller to download
204+
205+
The `openbot-agent-computer` image carried two copies of Chromium: the full browser it runs, and
206+
Playwright's separate headless shell, which it never starts. Every launch names a Chromium channel,
207+
and Playwright runs the full browser for a named channel even with `COMPUTER_BROWSER_MODE=headless`.
208+
The image now installs only the full browser and drops the package cache left from installing it.
209+
The download falls from 537 MB to about 423 MB on arm64 and from 520 MB to about 411 MB on amd64.
210+
Unpacked, the image is about 375 MB smaller on arm64 and 296 MB smaller on amd64. The all-in-one `openbot` image installs the same browser the same way and shrinks by about
211+
as much. The browser and its behaviour are unchanged. On a desktop install the computer is the
212+
largest image, so a first install and each upgrade download less.
213+
203214
### A Bot can send, draft and reply in Gmail
204215

205216
OpenBot left out every Composio action that takes a file, because a Bot has no way to supply one.

‎Dockerfile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ ENV DEBIAN_FRONTEND=noninteractive
3131
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
3232
COPY --from=node-toolchain /usr/local /usr/local
3333
COPY --from=bun-toolchain /usr/local/bin/bun /usr/local/bin/bun
34+
# `--no-shell` and the bunx cache: see agent-computer/Dockerfile, which installs the same browser.
3435
RUN apt-get update && apt-get install -y --no-install-recommends \
3536
ca-certificates curl unzip xz-utils \
3637
&& ln -s bun /usr/local/bin/bunx \
37-
&& bunx --bun "playwright@${PLAYWRIGHT_VERSION}" install --with-deps chromium \
38-
&& rm -rf /root/.cache /tmp/* /var/lib/apt/lists/* \
38+
&& bunx --bun "playwright@${PLAYWRIGHT_VERSION}" install --with-deps --no-shell chromium \
39+
&& rm -rf /root/.cache /root/.bun /usr/local/install/cache /tmp/* /var/lib/apt/lists/* \
3940
# PINNED, BECAUSE THE CHART NAMES THESE NUMBERS. `computers.podSecurityContext` runs a computer
4041
# pod as 1001, and without `--uid` that is only where these happen to land today: `ubuntu:24.04`
4142
# ships its own `ubuntu` user at 1000, so the next two are 1001 and 1002. Let the base add one

‎agent-computer/Dockerfile‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ ENV DEBIAN_FRONTEND=noninteractive
1515
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
1616
COPY --from=node-toolchain /usr/local /usr/local
1717
COPY --from=bun-toolchain /usr/local/bin/bun /usr/local/bin/bun
18+
# `--no-shell`: every launch names a Chromium channel (`browser-runtime.ts`), and Playwright runs
19+
# the full build for a named channel even when headless, so the headless shell is never started. It
20+
# was 340 MB unpacked and about 106 MB of every download. The bunx package cache goes too: Bun
21+
# writes it under both BUN_INSTALL and the home directory, 35 MB the image never reads.
1822
RUN apt-get update && apt-get install -y --no-install-recommends \
1923
ca-certificates curl unzip xz-utils \
2024
&& ln -s bun /usr/local/bin/bunx \
21-
&& bunx --bun "playwright@${PLAYWRIGHT_VERSION}" install --with-deps chromium \
22-
&& rm -rf /root/.cache /tmp/* /var/lib/apt/lists/*
25+
&& bunx --bun "playwright@${PLAYWRIGHT_VERSION}" install --with-deps --no-shell chromium \
26+
&& rm -rf /root/.cache /root/.bun /usr/local/install/cache /tmp/* /var/lib/apt/lists/*
2327

2428
WORKDIR /app
2529
# The lockfile as well as the manifest: `--frozen-lockfile` with no lockfile present resolves afresh

‎agent-computer/tests/sign-in.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ beforeAll(async () => {
105105
origin = `http://127.0.0.1:${server.port}`;
106106
if (!asked) return;
107107
const { chromium } = await import("playwright");
108-
browser = await chromium.launch();
108+
// A named channel, as the computer launches: the image has no headless shell for a bare launch.
109+
browser = await chromium.launch({ channel: "chromium" });
109110
});
110111

111112
afterAll(async () => {

‎app/src/components/app-sidebar/app-sidebar.tsx‎

Lines changed: 38 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
import {
2-
IconBolt,
3-
IconBox,
4-
IconLogout,
5-
IconPlug,
6-
IconPlus,
7-
IconSearch,
8-
IconSettings,
9-
IconShieldLock,
10-
} from "@tabler/icons-react";
1+
import { IconLogout, IconPlus, IconSearch } from "@tabler/icons-react";
112
import {
123
useInfiniteQuery,
134
useMutation,
@@ -54,6 +45,7 @@ import {
5445
import { useChannelEvents } from "@/lib/channels/use-channel-events";
5546
import { appConfig } from "@/lib/generated/application-config";
5647
import { EASE_OUT, ENTRANCE_SECONDS } from "@/lib/motion";
48+
import { navigationFor } from "@/lib/navigation";
5749
import { relativeTime } from "@/lib/relative-time";
5850
import {
5951
type MessageListEmphasis,
@@ -66,8 +58,6 @@ import { Channel } from "./channel";
6658
import { ChannelPagination } from "./channel-pagination";
6759

6860
const appLinkOptions = { to: "/" } satisfies LinkOptions;
69-
const adminLinkOptions = { to: "/admin" } satisfies LinkOptions;
70-
const settingsLinkOptions = { to: "/settings" } satisfies LinkOptions;
7161

7262
const userMenuItemClassName = "gap-2 px-2 py-1.5";
7363

@@ -238,6 +228,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
238228
*/
239229
const animateOrder =
240230
!searching && (channels.data?.length ?? 0) <= MAX_ANIMATED_ROWS;
231+
const navigation = navigationFor(currentUser?.role);
241232

242233
const handleSignOut = async () => {
243234
await signOut.mutateAsync();
@@ -349,68 +340,29 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
349340
</SidebarContent>
350341
<SidebarFooter>
351342
<SidebarMenu className="gap-px">
352-
<SidebarMenuItem>
353-
<SidebarMenuButton
354-
className="hover:bg-foreground/5 h-10"
355-
render={(props) => (
356-
<Link
357-
{...props}
358-
to="/bots"
359-
activeProps={{ className: "bg-foreground/5" }}
360-
/>
361-
)}
362-
>
363-
<div className="size-[28px] flex items-center justify-center">
364-
<IconBolt />
365-
</div>
366-
<span className="text-sm">Bots</span>
367-
{/* What waits on you across every Bot; Bots lists them first. */}
368-
<BotsNavBadge />
369-
</SidebarMenuButton>
370-
</SidebarMenuItem>
371-
{/*
372-
* Beside Bots rather than inside Admin: each is somebody's own. Capabilities are your skills
373-
* and what your Bots remember about you; Connections are the apps a Bot reaches as you.
374-
* Capabilities links to `/capabilities` rather than a tab, so it stays lit on both tabs.
375-
*/}
376-
<SidebarMenuItem>
377-
<SidebarMenuButton
378-
className="hover:bg-foreground/5 h-10"
379-
render={(props) => (
380-
<Link
381-
{...props}
382-
to="/capabilities"
383-
activeProps={{
384-
className: "bg-foreground/5",
385-
}}
386-
/>
387-
)}
388-
>
389-
<div className="size-[28px] flex items-center justify-center">
390-
<IconBox />
391-
</div>
392-
<span className="text-sm trackint-tight">Capabilities</span>
393-
</SidebarMenuButton>
394-
</SidebarMenuItem>
395-
<SidebarMenuItem>
396-
<SidebarMenuButton
397-
className="hover:bg-foreground/5 h-10"
398-
render={(props) => (
399-
<Link
400-
{...props}
401-
to="/connections"
402-
activeProps={{
403-
className: "bg-foreground/5",
404-
}}
405-
/>
406-
)}
407-
>
408-
<div className="size-[28px] flex items-center justify-center">
409-
<IconPlug />
410-
</div>
411-
<span className="text-sm trackint-tight">Connections</span>
412-
</SidebarMenuButton>
413-
</SidebarMenuItem>
343+
{navigation
344+
.filter((item) => item.section === "primary")
345+
.map((item) => (
346+
<SidebarMenuItem key={item.id}>
347+
<SidebarMenuButton
348+
className="hover:bg-foreground/5 h-10"
349+
render={(props) => (
350+
<Link
351+
{...props}
352+
to={item.to}
353+
activeProps={{ className: "bg-foreground/5" }}
354+
/>
355+
)}
356+
>
357+
<div className="size-[28px] flex items-center justify-center">
358+
<item.icon />
359+
</div>
360+
<span className="text-sm">{item.label}</span>
361+
{/* What waits on you across every Bot; Bots lists them first. */}
362+
{item.id === "bots" ? <BotsNavBadge /> : null}
363+
</SidebarMenuButton>
364+
</SidebarMenuItem>
365+
))}
414366
<SidebarMenuItem>
415367
<DropdownMenu>
416368
<DropdownMenuTrigger
@@ -429,23 +381,18 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
429381
side="top"
430382
sideOffset={8}
431383
>
432-
{/* Admin routes are server-guarded; hide the entry for users who cannot open them. */}
433-
{currentUser?.role === "admin" ? (
434-
<DropdownMenuItem
435-
className={userMenuItemClassName}
436-
render={<Link {...adminLinkOptions} />}
437-
>
438-
<IconShieldLock />
439-
Admin
440-
</DropdownMenuItem>
441-
) : null}
442-
<DropdownMenuItem
443-
className={userMenuItemClassName}
444-
render={<Link {...settingsLinkOptions} />}
445-
>
446-
<IconSettings />
447-
Settings
448-
</DropdownMenuItem>
384+
{navigation
385+
.filter((item) => item.section === "account")
386+
.map((item) => (
387+
<DropdownMenuItem
388+
className={userMenuItemClassName}
389+
key={item.id}
390+
render={<Link to={item.to} />}
391+
>
392+
<item.icon />
393+
{item.label}
394+
</DropdownMenuItem>
395+
))}
449396
<DropdownMenuItem
450397
className={userMenuItemClassName}
451398
disabled={signOut.isPending}

‎app/src/components/channels/composer/composer.tsx‎

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,7 @@ export function Composer({
13451345
<Button
13461346
aria-label="Stop the Bot"
13471347
className={actionClassName}
1348+
data-slot="composer-stop"
13481349
data-testid="composer-stop"
13491350
onClick={onStop}
13501351
size="icon"
@@ -1374,6 +1375,7 @@ export function Composer({
13741375
<Button
13751376
aria-label={sendLabel}
13761377
className={actionClassName}
1378+
data-slot="composer-send"
13771379
disabled={!canSend}
13781380
size="icon"
13791381
type="submit"
@@ -1479,6 +1481,7 @@ export function Composer({
14791481
{tooManyStagedNotice}
14801482
<form
14811483
aria-busy={isBusy}
1484+
data-slot="composer"
14821485
className={cn(
14831486
/*
14841487
* `py-3` IS LOAD-BEARING ONCE THE TEXT WRAPS. On one line `min-h-14` and the controls
@@ -1520,6 +1523,7 @@ export function Composer({
15201523
<Button
15211524
aria-label="Attach a file"
15221525
className="self-end"
1526+
data-slot="composer-attach"
15231527
// The button stays, and stays labelled: a conversation that cannot take another
15241528
// message has not lost the ability to attach, it has lost the message. Swapping it
15251529
// for the "unavailable" placeholder would say the wrong thing about why.
@@ -1543,23 +1547,26 @@ export function Composer({
15431547
<IconPlus className="size-5" />
15441548
</Button>
15451549
)}
1546-
<PromptArea
1547-
aria-label="Message"
1548-
className={cn(
1549-
"min-w-0 flex-1 border-0 bg-transparent p-0 text-sm shadow-none",
1550-
editorClassName,
1551-
)}
1552-
disabled={disabled}
1553-
maxHeight={COMPACT_MAX_HEIGHT_PX}
1554-
minHeight={COMPACT_MIN_HEIGHT_PX}
1555-
onChange={handleChange}
1556-
onImagePaste={canAttach ? stagePastedImage : undefined}
1557-
onSubmit={submitDraft}
1558-
placeholder="Ask anything"
1559-
ref={promptAreaRef}
1560-
triggers={triggers}
1561-
value={value}
1562-
/>
1550+
{/* The slot is ours: `PromptArea` passes no attribute through to its own box. */}
1551+
<div className="min-w-0 flex-1" data-slot="composer-input">
1552+
<PromptArea
1553+
aria-label="Message"
1554+
className={cn(
1555+
"w-full border-0 bg-transparent p-0 text-sm shadow-none",
1556+
editorClassName,
1557+
)}
1558+
disabled={disabled}
1559+
maxHeight={COMPACT_MAX_HEIGHT_PX}
1560+
minHeight={COMPACT_MIN_HEIGHT_PX}
1561+
onChange={handleChange}
1562+
onImagePaste={canAttach ? stagePastedImage : undefined}
1563+
onSubmit={submitDraft}
1564+
placeholder="Ask anything"
1565+
ref={promptAreaRef}
1566+
triggers={triggers}
1567+
value={value}
1568+
/>
1569+
</div>
15631570
<DictationButton
15641571
dictation={dictation}
15651572
disabled={disabled || voiceCall?.active === true}
@@ -1585,6 +1592,7 @@ export function Composer({
15851592
<form
15861593
aria-busy={isBusy}
15871594
className="overflow-hidden rounded-2xl border border-border bg-card"
1595+
data-slot="composer"
15881596
onSubmit={handleFormSubmit}
15891597
>
15901598
<DictationSurface
@@ -1600,30 +1608,33 @@ export function Composer({
16001608
images={images}
16011609
onRemove={discardAttachment}
16021610
/>
1603-
<PromptArea
1604-
aria-label="Message"
1605-
autoGrow
1606-
className={cn(
1607-
"w-full border-0 bg-transparent p-0 text-sm shadow-none",
1608-
editorClassName,
1609-
)}
1610-
disabled={disabled}
1611-
maxHeight={MAX_HEIGHT_PX}
1612-
onChange={handleChange}
1613-
onImagePaste={canAttach ? stagePastedImage : undefined}
1614-
onSubmit={submitDraft}
1615-
placeholder="Ask anything"
1616-
ref={promptAreaRef}
1617-
triggers={triggers}
1618-
value={value}
1619-
/>
1611+
<div data-slot="composer-input">
1612+
<PromptArea
1613+
aria-label="Message"
1614+
autoGrow
1615+
className={cn(
1616+
"w-full border-0 bg-transparent p-0 text-sm shadow-none",
1617+
editorClassName,
1618+
)}
1619+
disabled={disabled}
1620+
maxHeight={MAX_HEIGHT_PX}
1621+
onChange={handleChange}
1622+
onImagePaste={canAttach ? stagePastedImage : undefined}
1623+
onSubmit={submitDraft}
1624+
placeholder="Ask anything"
1625+
ref={promptAreaRef}
1626+
triggers={triggers}
1627+
value={value}
1628+
/>
1629+
</div>
16201630
</div>
16211631

16221632
<div className="flex items-center justify-between">
16231633
{attachmentsEnabled ? (
16241634
<Button
16251635
aria-label="Attach a file"
16261636
className="size-7 rounded-full p-0"
1637+
data-slot="composer-attach"
16271638
disabled={disabled}
16281639
onClick={() => fileInputRef.current?.click()}
16291640
type="button"

‎app/src/components/channels/conversation-view.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,10 @@ export function ConversationView({
438438
working={working}
439439
/>
440440
</div>
441-
<div className="max-w-2xl mx-auto w-full px-0 pb-4 shrink-0">
441+
<div
442+
className="max-w-2xl mx-auto w-full px-0 pb-4 shrink-0"
443+
data-slot="composer-column"
444+
>
442445
{notice}
443446
<Composer
444447
agents={agents}

0 commit comments

Comments
 (0)