Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

fix(desktop): name this computer by its host name in Computer access

leepokai8ca34bcf3374
diff --git a/apps/desktop/src/renderer/lib/computer-access.test.ts b/apps/desktop/src/renderer/lib/computer-access.test.ts
index 1fdc1bcd..15b1d143 100644
--- a/apps/desktop/src/renderer/lib/computer-access.test.ts
+++ b/apps/desktop/src/renderer/lib/computer-access.test.ts
@@ -13,6 +13,21 @@ registerHooks({ resolve(specifier, context, nextResolve) {
return nextResolve(specifier, context)
} })
+test('permission setup uses the local host identity even when a remote computer is selected', async () => {
+ Object.assign(globalThis, { window: { codync: { computerName: 'OS computer name' } } })
+ const local = { hostName: 'Local host' }
+ const state = { local: local as typeof local | null, selectedStore: { hostName: 'Remote host' } }
+ const { ComputerAccess } = await import('../store/computer-access.ts')
+ const access = new ComputerAccess(state as unknown as AppModel)
+ assert.equal(access.computerName, 'Local host')
+ local.hostName = 'Renamed local host'
+ assert.equal(access.computerName, 'Renamed local host')
+ state.local = null
+ assert.equal(access.computerName, 'OS computer name')
+ window.codync.computerName = ''
+ assert.equal(access.computerName, 'Your computer')
+})
+
test('repeated checks never request permissions; explicit actions and failures stay reviewable', async () => {
const calls: string[] = []
let fail = false
diff --git a/apps/desktop/src/renderer/store/computer-access.ts b/apps/desktop/src/renderer/store/computer-access.ts
index 5cb22f2f..b48ce32d 100644
--- a/apps/desktop/src/renderer/store/computer-access.ts
+++ b/apps/desktop/src/renderer/store/computer-access.ts
@@ -22,6 +22,7 @@ export class ComputerAccess extends Observable {
}
get helperName() { return this.screen?.permissionApp || 'Codync Screen' }
+ get computerName() { return this.app.local?.hostName || window.codync.computerName || 'Your computer' }
get error() { return this.checkError ?? this.actionError }
async refresh() {
diff --git a/apps/desktop/src/renderer/views/computer-access/ComputerAccessView.tsx b/apps/desktop/src/renderer/views/computer-access/ComputerAccessView.tsx
index 4c765f72..9c8f0bfb 100644
--- a/apps/desktop/src/renderer/views/computer-access/ComputerAccessView.tsx
+++ b/apps/desktop/src/renderer/views/computer-access/ComputerAccessView.tsx
@@ -28,7 +28,7 @@ export function ComputerAccessView({ onContinue }: { onContinue?: (ready: boolea
<header className="computer-access-header">
<div className="computer-access-identity">
<img src={appIcon} width={40} height={40} alt="Codync" />
- <div><span>This computer</span><strong>{window.codync.computerName || 'Your computer'}</strong></div>
+ <div><span>This computer</span><strong>{access.computerName}</strong></div>
</div>
<h1>{ready ? 'Your computer is ready' : 'Computer access'}</h1>
<p>{windows ? 'Let a bot work in your apps. You choose which bots can use this computer.' : 'Work in your apps with a bot, or access your screen from your phone. You choose which bots can use this computer.'}</p>