diff --git a/src/mms/bots/sandbox/mousseRunner.ts b/src/mms/bots/sandbox/mousseRunner.ts index ccf8a2661e..292f31e169 100644 --- a/src/mms/bots/sandbox/mousseRunner.ts +++ b/src/mms/bots/sandbox/mousseRunner.ts @@ -280,7 +280,7 @@ export function heldToolEnv(toolHome: string | undefined): Array posix.join(toolHome, name) return [ - ['GH_CONFIG_DIR', at('gh')], ['GIT_CONFIG_GLOBAL', at('gitconfig')], ['XDG_CONFIG_HOME', at('config')], ['XDG_CACHE_HOME', at('cache')], + ['GH_CONFIG_DIR', posix.join(toolHome, 'gh')], ['GIT_CONFIG_GLOBAL', at('gitconfig')], ['XDG_CONFIG_HOME', at('config')], ['XDG_CACHE_HOME', at('cache')], ['npm_config_cache', at('npm')], ['npm_config_userconfig', at('npmrc')], ['PIP_CACHE_DIR', at('pip')], ['PIP_CONFIG_FILE', '/dev/null'] ] } diff --git a/src/mms/harness/pi/engine.ts b/src/mms/harness/pi/engine.ts index 48af0a57cc..447dfb07f2 100644 --- a/src/mms/harness/pi/engine.ts +++ b/src/mms/harness/pi/engine.ts @@ -1794,7 +1794,7 @@ export class PiRpcEngine implements ProviderAdapter { } const turn = new PiTurn(key, host.bridge?.turnToken ?? key, input, sink, ctl, host, tools, builtins) // A bot whose `bash` is held: its commands join its own sandbox network, started now (none: each its own). - if (host.bot?.sandbox.policy.kind === 'held' && builtins.includes('bash')) { + if (host.bot?.sandbox?.policy.kind === 'held' && builtins.includes('bash')) { try { turn.localNetwork = await host.bot.sandbox.localNetwork?.(host.bot.sandbox.policy) } catch { diff --git a/src/shared/bots/personal/localServers.ts b/src/shared/bots/personal/localServers.ts index 0b78584fcc..c43ad8223b 100644 --- a/src/shared/bots/personal/localServers.ts +++ b/src/shared/bots/personal/localServers.ts @@ -132,7 +132,8 @@ export function forwardChangeProblem(value: unknown): string | undefined { */ export function forwardUrl(forward: Pick): string { if (!forward.browser) return `http://127.0.0.1:${forward.hostPort}/` - return `http://f${forward.id.replace(/[^0-9a-z]/gi, '').slice(0, 8).toLowerCase()}.localhost:${forward.hostPort}/` + const host = `f${forward.id.replace(/[^0-9a-z]/gi, '').slice(0, 8).toLowerCase()}.localhost` + return `http://${host}:${forward.hostPort}/` } /** A forward's row in the dialog: its title and where it goes. */ diff --git a/src/shared/bridge/deviceActivity.ts b/src/shared/bridge/deviceActivity.ts index 8d186e59f7..5bb1198dd4 100644 --- a/src/shared/bridge/deviceActivity.ts +++ b/src/shared/bridge/deviceActivity.ts @@ -189,6 +189,8 @@ const DEVICE_ACCESS: Phrase = phrase('Changed what a device may do here', 'chang const DEVICE_BLOCK: Phrase = phrase('Blocked or unblocked a device', 'blocked or unblocked a device', 'blocked or unblocked devices {n} times') const DEVICE_REMOVE: Phrase = phrase('Removed a device', 'removed a device', 'removed {n} devices') const DEVICE_WORK: Phrase = phrase('Changed whether your other devices may work here', 'changed whether your other devices may work here', 'changed whether your other devices may work here {n} times') +const SECRET_SHARE: Phrase = phrase('Shared secrets with a thread', 'shared secrets with a thread', 'shared secrets with threads {n} times') +const SECRET_REVOKE: Phrase = phrase('Revoked shared secrets', 'revoked shared secrets', 'revoked shared secrets {n} times') const OTHER: Phrase = phrase('Made a change', 'made a change', 'made {n} other changes') /** A change that is a notice to the owner, not a thing to count. */ @@ -354,7 +356,9 @@ const PHRASES: Record = { 'devices.policy': DEVICE_ACCESS, 'devices.block': DEVICE_BLOCK, 'devices.remove': DEVICE_REMOVE, - 'devices.workOnThreads': DEVICE_WORK + 'devices.workOnThreads': DEVICE_WORK, + 'secrets.share': SECRET_SHARE, + 'secrets.shares.revoke': SECRET_REVOKE } /** Every method the owner audits as a change that has words of its own; the test checks it against the routed table. */ diff --git a/tests/bots/botFixture.ts b/tests/bots/botFixture.ts index d54101000c..0aa8e6bbec 100644 --- a/tests/bots/botFixture.ts +++ b/tests/bots/botFixture.ts @@ -289,8 +289,10 @@ export function botFixture(options: Pick { diff --git a/tests/bots/botSubagentDelegations.test.ts b/tests/bots/botSubagentDelegations.test.ts index f698bace9c..33d1b50f91 100644 --- a/tests/bots/botSubagentDelegations.test.ts +++ b/tests/bots/botSubagentDelegations.test.ts @@ -442,7 +442,7 @@ describe('a bot\'s work subagents as delegations', () => { expect(shape(run)).toEqual(shape(previous)) run.close() const bots = new DatabaseSync(paths.botsDb) - bots.exec(`DROP TABLE bot_file_access; DELETE FROM run_schema_migrations WHERE version = 20; DROP TABLE bot_sandbox; DELETE FROM run_schema_migrations WHERE version = 19; DROP TABLE bot_owner_ask_launches; DROP TABLE bot_owner_asks; + bots.exec(`DELETE FROM run_schema_migrations WHERE version IN (21, 22); DROP TABLE bot_file_access; DELETE FROM run_schema_migrations WHERE version = 20; DROP TABLE bot_sandbox; DELETE FROM run_schema_migrations WHERE version = 19; DROP TABLE bot_owner_ask_launches; DROP TABLE bot_owner_asks; DROP INDEX bot_jobs_open_by_owner_ask; ALTER TABLE bot_jobs DROP COLUMN owner_ask_id; ALTER TABLE bot_reminders DROP COLUMN owner_asks_json; DELETE FROM run_schema_migrations WHERE version = 18; ALTER TABLE bot_reminders DROP COLUMN device_json; ALTER TABLE bot_actions DROP COLUMN answered_from_json; diff --git a/tests/ptyLiveness.test.ts b/tests/ptyLiveness.test.ts index 843e84aef9..1f0b696d39 100644 --- a/tests/ptyLiveness.test.ts +++ b/tests/ptyLiveness.test.ts @@ -84,8 +84,8 @@ describe('thread switching terminal lifecycle', () => { expect(appSource).toMatch(/Keep terminal PTYs and browser guests mounted/) const mainPane = appSource.match(//)?.[0] expect(mainPane).toBeDefined() - // Active while the panel is open in the projects layout, and while it slides out after closing. - expect(appSource).toMatch(/const panelOpen = mainAreaOpen && layoutMode === 'projects'/) + // Active while the panel is open, and while it slides out after closing. + expect(appSource).toMatch(/const panelOpen = mainAreaOpen && panelAvailable/) expect(appSource).toMatch(/const panelShown = panelOpen \|\| panelClosing/) expect(mainPane).toMatch(/active=\{panelShown\}[^>]*\bpreserveLayout\b/) expect(mainPane).toMatch(/]*\/>/) diff --git a/tests/renderer/keyboardFocusFill.test.ts b/tests/renderer/keyboardFocusFill.test.ts index 4ab1809777..cdad8fde81 100644 --- a/tests/renderer/keyboardFocusFill.test.ts +++ b/tests/renderer/keyboardFocusFill.test.ts @@ -65,7 +65,8 @@ const TEXT_FIELD_BORDERS = new Set([ '.start-from-pr-input:focus', '.scheduled-input:focus-visible', '.thread-filter-field:focus-visible', - '.threads-sidebar-rename-input:focus' + '.threads-sidebar-rename-input:focus', + '.secform-name:focus' ]) const where = (rule: FocusRule) => `${rule.file}:${rule.line} ${rule.selectors.join(', ')}` diff --git a/tests/renderer/remoteBots.test.ts b/tests/renderer/remoteBots.test.ts index 2f22de8dd2..ffe986de78 100644 --- a/tests/renderer/remoteBots.test.ts +++ b/tests/renderer/remoteBots.test.ts @@ -342,7 +342,7 @@ describe('the chat of a bot of another computer', () => { fake.chats['n_laptop:b_inbox'] = [message(1, { author: 'owner', text: 'Hi' }), message(2, { text: 'Hello!' })] await open(remote({ lives: { ...LAPTOP, level: 'full' } }), fake.chats['n_laptop:b_inbox']) await type(box()!, '/') - expect(options().length).toBe(10) + expect(options().length).toBe(11) expect(options().filter((option) => option.getAttribute('aria-disabled') === 'true')).toEqual([]) await press('Escape') await run('/clear') diff --git a/tests/renderer/subagentOptimisticWorking.test.ts b/tests/renderer/subagentOptimisticWorking.test.ts index 4c2afdb969..4065130707 100644 --- a/tests/renderer/subagentOptimisticWorking.test.ts +++ b/tests/renderer/subagentOptimisticWorking.test.ts @@ -9,6 +9,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { LineageSection } from '../../src/renderer/components/sideCard/LineageSection' import { findSubagentEntry, isSubagentStartingOptimistically } from '../../src/renderer/components/subagentStatus' import { isNewEmptyThread } from '../../src/renderer/lib/newThread' +import { setSidePanelSettings } from '../../src/renderer/lib/sidePanelSettings' import { useAppStore } from '../../src/renderer/stores/appStore' import { getDefaultSettings } from '../../src/shared/settings' import type { SubagentSummary } from '../../src/shared/subagents' @@ -163,6 +164,8 @@ describe('clicking a starting subagent in Nest', () => { } beforeEach(() => { + // Subagent opening here exercises the full-pane OrchestratorChat view; side-panel opening is covered in sideChatsPanel.test.ts. + setSidePanelSettings({ openBotThreadsInSidePanel: true, openSubagentsInSidePanel: false }) vi.stubGlobal('ResizeObserver', class { observe() {} unobserve() {} disconnect() {} }) window.matchMedia = ((query: string) => ({ matches: false, @@ -199,6 +202,7 @@ describe('clicking a starting subagent in Nest', () => { afterEach(() => { act(() => root.unmount()) host.remove() + setSidePanelSettings({ openBotThreadsInSidePanel: true, openSubagentsInSidePanel: true }) useAppStore.setState(useAppStore.getInitialState()) vi.unstubAllGlobals() }) diff --git a/tests/startupAppearance.test.ts b/tests/startupAppearance.test.ts index 46426fc789..aefdaa5439 100644 --- a/tests/startupAppearance.test.ts +++ b/tests/startupAppearance.test.ts @@ -38,7 +38,7 @@ it('reads saved appearance from the active default profile without rewriting eit writeFileSync(join(profileRoot, 'mousse.conf'), config) const shared = JSON.stringify({ settings: { appearance: fallback } }) writeFileSync(join(directory, 'mousse.conf'), shared) - expect(readStartupAppearance(directory, fallback)).toEqual({ ...saved, renderMath: true, replyPacing: true, threadProjectColors: 'off', replyPreviews: false, threadPathInTitleBar: true, interfaceFont: { source: 'default' }, codeFont: { source: 'default' }, animationSpeed: 'normal', turnChangedFiles: 'summary', chatWidth: 'normal', frostedComposer: false, frostedComposerOpacity: 60, frostedComposerBlur: 6, frostedComposerSaturation: 1.12, contextRingInComposer: false, userThemes: [], userTheme: '' }) + expect(readStartupAppearance(directory, fallback)).toEqual({ ...saved, renderMath: true, replyPacing: true, threadProjectColors: 'off', replyPreviews: false, threadPathInTitleBar: true, interfaceFont: { source: 'default' }, codeFont: { source: 'default' }, animationSpeed: 'normal', turnChangedFiles: 'summary', chatWidth: 'normal', frostedComposer: false, frostedComposerOpacity: 60, frostedComposerBlur: 6, frostedComposerSaturation: 1.12, contextRingInComposer: false, openBotThreadsInSidePanel: true, openSubagentsInSidePanel: true, userThemes: [], userTheme: '' }) expect(readFileSync(join(profileRoot, 'mousse.conf'), 'utf8')).toBe(config) expect(readFileSync(join(directory, 'mousse.conf'), 'utf8')).toBe(shared) }) diff --git a/tests/themeSelectors.test.ts b/tests/themeSelectors.test.ts index 93f4eeb103..b4a75bd9a0 100644 --- a/tests/themeSelectors.test.ts +++ b/tests/themeSelectors.test.ts @@ -103,6 +103,7 @@ const PERMISSION_MODE_REVIEWED: Record = { 'src/renderer/components/ComposerEffortPicker.tsx': 'hosts the menu; the choices are ComposerPermissionPicker', 'src/renderer/components/OrchestratorChat.tsx': 'the handler, no control', 'src/renderer/components/sideChats/SideChatsPanel.tsx': 'a side chat\'s handler, no control; the menu is ComposerPermissionPicker', + 'src/renderer/components/sideChats/SideThreadColumn.tsx': 'a side thread\'s handler, no control; the menu is ComposerPermissionPicker', 'src/renderer/components/settings/GeneralSettings.tsx': 'Settings → General, guarded with the page', 'src/renderer/components/automations/AutomationDetail.tsx': 'only on the Automations page, guarded with it', 'src/renderer/components/automations/inbox/EditDetailsPane.tsx': 'only on the Automations page, guarded with it'